Remove BOOST_NO_CXX11_RVALUE_REFERENCES

This commit is contained in:
Christian Mazakas 2023-08-31 13:11:31 -07:00
parent 3f0f8efbba
commit 0c7b51cc16
8 changed files with 9 additions and 178 deletions

View File

@ -2987,22 +2987,6 @@ namespace boost {
return v.first; return v.first;
} }
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <class Second>
static key_type const& extract(
boost::rv<std::pair<key_type, Second> > const& v)
{
return v.first;
}
template <class Second>
static key_type const& extract(
boost::rv<std::pair<key_type const, Second> > const& v)
{
return v.first;
}
#endif
template <class Arg1> template <class Arg1>
static key_type const& extract(key_type const& k, Arg1 const&) static key_type const& extract(key_type const& k, Arg1 const&)
{ {

View File

@ -288,16 +288,6 @@ namespace boost {
return table_.move_insert_node_type_with_hint_unique(hint, np); return table_.move_insert_node_type_with_hint_unique(hint, np);
} }
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
(BOOST_COMP_GNUC && BOOST_COMP_GNUC < BOOST_VERSION_NUMBER(4, 6, 0))
private:
// Note: Use r-value node_type to insert.
insert_return_type insert(node_type&);
iterator insert(const_iterator, node_type& np);
public:
#endif
template <class... Args> template <class... Args>
std::pair<iterator, bool> try_emplace(key_type const& k, Args&&... args) std::pair<iterator, bool> try_emplace(key_type const& k, Args&&... args)
{ {
@ -420,18 +410,14 @@ namespace boost {
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_map<K, T, H2, P2, A>& source); void merge(boost::unordered_map<K, T, H2, P2, A>& source);
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_map<K, T, H2, P2, A>&& source); void merge(boost::unordered_map<K, T, H2, P2, A>&& source);
#endif
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_multimap<K, T, H2, P2, A>& source); void merge(boost::unordered_multimap<K, T, H2, P2, A>& source);
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_multimap<K, T, H2, P2, A>&& source); void merge(boost::unordered_multimap<K, T, H2, P2, A>&& source);
#endif
// observers // observers
@ -942,16 +928,6 @@ namespace boost {
return table_.move_insert_node_type_with_hint_equiv(hint, np); return table_.move_insert_node_type_with_hint_equiv(hint, np);
} }
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
(BOOST_COMP_GNUC && BOOST_COMP_GNUC < BOOST_VERSION_NUMBER(4, 6, 0))
private:
// Note: Use r-value node_type to insert.
iterator insert(node_type&);
iterator insert(const_iterator, node_type& np);
public:
#endif
iterator erase(iterator); iterator erase(iterator);
iterator erase(const_iterator); iterator erase(const_iterator);
size_type erase(const key_type&); size_type erase(const key_type&);
@ -980,18 +956,14 @@ namespace boost {
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_multimap<K, T, H2, P2, A>& source); void merge(boost::unordered_multimap<K, T, H2, P2, A>& source);
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_multimap<K, T, H2, P2, A>&& source); void merge(boost::unordered_multimap<K, T, H2, P2, A>&& source);
#endif
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_map<K, T, H2, P2, A>& source); void merge(boost::unordered_map<K, T, H2, P2, A>& source);
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_map<K, T, H2, P2, A>&& source); void merge(boost::unordered_map<K, T, H2, P2, A>&& source);
#endif
// observers // observers
@ -1477,7 +1449,6 @@ namespace boost {
table_.merge_unique(source.table_); table_.merge_unique(source.table_);
} }
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <class K, class T, class H, class P, class A> template <class K, class T, class H, class P, class A>
template <typename H2, typename P2> template <typename H2, typename P2>
void unordered_map<K, T, H, P, A>::merge( void unordered_map<K, T, H, P, A>::merge(
@ -1485,7 +1456,6 @@ namespace boost {
{ {
table_.merge_unique(source.table_); table_.merge_unique(source.table_);
} }
#endif
template <class K, class T, class H, class P, class A> template <class K, class T, class H, class P, class A>
template <typename H2, typename P2> template <typename H2, typename P2>
@ -1495,7 +1465,6 @@ namespace boost {
table_.merge_unique(source.table_); table_.merge_unique(source.table_);
} }
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <class K, class T, class H, class P, class A> template <class K, class T, class H, class P, class A>
template <typename H2, typename P2> template <typename H2, typename P2>
void unordered_map<K, T, H, P, A>::merge( void unordered_map<K, T, H, P, A>::merge(
@ -1503,7 +1472,6 @@ namespace boost {
{ {
table_.merge_unique(source.table_); table_.merge_unique(source.table_);
} }
#endif
// observers // observers
@ -2027,7 +1995,6 @@ namespace boost {
} }
} }
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <class K, class T, class H, class P, class A> template <class K, class T, class H, class P, class A>
template <typename H2, typename P2> template <typename H2, typename P2>
void unordered_multimap<K, T, H, P, A>::merge( void unordered_multimap<K, T, H, P, A>::merge(
@ -2037,7 +2004,6 @@ namespace boost {
insert(source.extract(source.begin())); insert(source.extract(source.begin()));
} }
} }
#endif
template <class K, class T, class H, class P, class A> template <class K, class T, class H, class P, class A>
template <typename H2, typename P2> template <typename H2, typename P2>
@ -2049,7 +2015,6 @@ namespace boost {
} }
} }
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <class K, class T, class H, class P, class A> template <class K, class T, class H, class P, class A>
template <typename H2, typename P2> template <typename H2, typename P2>
void unordered_multimap<K, T, H, P, A>::merge( void unordered_multimap<K, T, H, P, A>::merge(
@ -2059,7 +2024,6 @@ namespace boost {
insert(source.extract(source.begin())); insert(source.extract(source.begin()));
} }
} }
#endif
// lookup // lookup

View File

@ -287,16 +287,6 @@ namespace boost {
return table_.move_insert_node_type_with_hint_unique(hint, np); return table_.move_insert_node_type_with_hint_unique(hint, np);
} }
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
(BOOST_COMP_GNUC && BOOST_COMP_GNUC < BOOST_VERSION_NUMBER(4, 6, 0))
private:
// Note: Use r-value node_type to insert.
insert_return_type insert(node_type&);
iterator insert(const_iterator, node_type& np);
public:
#endif
iterator erase(const_iterator); iterator erase(const_iterator);
size_type erase(const key_type&); size_type erase(const key_type&);
iterator erase(const_iterator, const_iterator); iterator erase(const_iterator, const_iterator);
@ -324,18 +314,14 @@ namespace boost {
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_set<T, H2, P2, A>& source); void merge(boost::unordered_set<T, H2, P2, A>& source);
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_set<T, H2, P2, A>&& source); void merge(boost::unordered_set<T, H2, P2, A>&& source);
#endif
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_multiset<T, H2, P2, A>& source); void merge(boost::unordered_multiset<T, H2, P2, A>& source);
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_multiset<T, H2, P2, A>&& source); void merge(boost::unordered_multiset<T, H2, P2, A>&& source);
#endif
// observers // observers
@ -771,16 +757,6 @@ namespace boost {
return table_.move_insert_node_type_with_hint_equiv(hint, np); return table_.move_insert_node_type_with_hint_equiv(hint, np);
} }
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
(BOOST_COMP_GNUC && BOOST_COMP_GNUC < BOOST_VERSION_NUMBER(4, 6, 0))
private:
// Note: Use r-value node_type to insert.
iterator insert(node_type&);
iterator insert(const_iterator, node_type& np);
public:
#endif
iterator erase(const_iterator); iterator erase(const_iterator);
size_type erase(const key_type&); size_type erase(const key_type&);
@ -808,18 +784,14 @@ namespace boost {
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_multiset<T, H2, P2, A>& source); void merge(boost::unordered_multiset<T, H2, P2, A>& source);
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_multiset<T, H2, P2, A>&& source); void merge(boost::unordered_multiset<T, H2, P2, A>&& source);
#endif
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_set<T, H2, P2, A>& source); void merge(boost::unordered_set<T, H2, P2, A>& source);
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <typename H2, typename P2> template <typename H2, typename P2>
void merge(boost::unordered_set<T, H2, P2, A>&& source); void merge(boost::unordered_set<T, H2, P2, A>&& source);
#endif
// observers // observers
@ -1279,7 +1251,6 @@ namespace boost {
table_.merge_unique(source.table_); table_.merge_unique(source.table_);
} }
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <class T, class H, class P, class A> template <class T, class H, class P, class A>
template <typename H2, typename P2> template <typename H2, typename P2>
void unordered_set<T, H, P, A>::merge( void unordered_set<T, H, P, A>::merge(
@ -1287,7 +1258,6 @@ namespace boost {
{ {
table_.merge_unique(source.table_); table_.merge_unique(source.table_);
} }
#endif
template <class T, class H, class P, class A> template <class T, class H, class P, class A>
template <typename H2, typename P2> template <typename H2, typename P2>
@ -1297,7 +1267,6 @@ namespace boost {
table_.merge_unique(source.table_); table_.merge_unique(source.table_);
} }
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <class T, class H, class P, class A> template <class T, class H, class P, class A>
template <typename H2, typename P2> template <typename H2, typename P2>
void unordered_set<T, H, P, A>::merge( void unordered_set<T, H, P, A>::merge(
@ -1305,7 +1274,6 @@ namespace boost {
{ {
table_.merge_unique(source.table_); table_.merge_unique(source.table_);
} }
#endif
// lookup // lookup
@ -1682,7 +1650,6 @@ namespace boost {
} }
} }
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <class T, class H, class P, class A> template <class T, class H, class P, class A>
template <typename H2, typename P2> template <typename H2, typename P2>
void unordered_multiset<T, H, P, A>::merge( void unordered_multiset<T, H, P, A>::merge(
@ -1692,7 +1659,6 @@ namespace boost {
insert(source.extract(source.begin())); insert(source.extract(source.begin()));
} }
} }
#endif
template <class T, class H, class P, class A> template <class T, class H, class P, class A>
template <typename H2, typename P2> template <typename H2, typename P2>
@ -1704,7 +1670,6 @@ namespace boost {
} }
} }
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <class T, class H, class P, class A> template <class T, class H, class P, class A>
template <typename H2, typename P2> template <typename H2, typename P2>
void unordered_multiset<T, H, P, A>::merge( void unordered_multiset<T, H, P, A>::merge(
@ -1714,7 +1679,6 @@ namespace boost {
insert(source.extract(source.begin())); insert(source.extract(source.begin()));
} }
} }
#endif
// lookup // lookup

View File

@ -177,7 +177,6 @@ namespace test {
void dummy_member() const {} void dummy_member() const {}
}; };
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
class movable2 class movable2
{ {
public: public:
@ -193,9 +192,6 @@ namespace test {
movable2(movable2 const&); movable2(movable2 const&);
movable2& operator=(movable2 const&); movable2& operator=(movable2 const&);
}; };
#else
typedef movable1 movable2;
#endif
template <class T> class hash template <class T> class hash
{ {

View File

@ -218,13 +218,11 @@ template <class X> void unordered_destructible_test(X&)
X x1; X x1;
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
X x2(rvalue_default<X>()); X x2(rvalue_default<X>());
X x3 = rvalue_default<X>(); X x3 = rvalue_default<X>();
// This can only be done if propagate_on_container_move_assignment::value // This can only be done if propagate_on_container_move_assignment::value
// is true. // is true.
// x2 = rvalue_default<X>(); // x2 = rvalue_default<X>();
#endif
X* ptr = new X(); X* ptr = new X();
X& a1 = *ptr; X& a1 = *ptr;
@ -727,9 +725,7 @@ void unordered_test(X& x, Key& k, Hash& hf, Pred& eq)
a.rehash(100); a.rehash(100);
a.merge(a2); a.merge(a2);
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
a.merge(rvalue_default<X>()); a.merge(rvalue_default<X>());
#endif
// Avoid unused variable warnings: // Avoid unused variable warnings:
@ -864,12 +860,10 @@ void unordered_movable_test(X& x, Key& k, T& /* t */, Hash& hf, Pred& eq)
typedef typename X::const_iterator const_iterator; typedef typename X::const_iterator const_iterator;
typedef typename X::allocator_type allocator_type; typedef typename X::allocator_type allocator_type;
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
X x1(rvalue_default<X>()); X x1(rvalue_default<X>());
X x2(std::move(x1)); X x2(std::move(x1));
x1 = rvalue_default<X>(); x1 = rvalue_default<X>();
x2 = std::move(x1); x2 = std::move(x1);
#endif
X a; X a;
allocator_type m = a.get_allocator(); allocator_type m = a.get_allocator();

View File

@ -23,12 +23,7 @@
namespace move_tests { namespace move_tests {
test::seed_t initialize_seed(98624); test::seed_t initialize_seed(98624);
#if defined(BOOST_UNORDERED_USE_MOVE) || \
!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#define BOOST_UNORDERED_TEST_MOVING 1 #define BOOST_UNORDERED_TEST_MOVING 1
#else
#define BOOST_UNORDERED_TEST_MOVING 0
#endif
template <class T> T empty(T*) { return T(); } template <class T> T empty(T*) { return T(); }
@ -73,8 +68,6 @@ namespace move_tests {
BOOST_TEST(y.max_load_factor() == 1.0); BOOST_TEST(y.max_load_factor() == 1.0);
#endif #endif
test::check_equivalent_keys(y); test::check_equivalent_keys(y);
#if defined(BOOST_UNORDERED_USE_MOVE) || \
!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#ifdef BOOST_UNORDERED_FOA_TESTS #ifdef BOOST_UNORDERED_FOA_TESTS
using allocator_type = typename T::allocator_type; using allocator_type = typename T::allocator_type;
@ -86,7 +79,6 @@ namespace move_tests {
} }
#else #else
BOOST_TEST_EQ(test::detail::tracker.count_allocations, 0u); BOOST_TEST_EQ(test::detail::tracker.count_allocations, 0u);
#endif
#endif #endif
} }
@ -126,8 +118,7 @@ namespace move_tests {
T y; T y;
y = empty(p); y = empty(p);
#if defined(BOOST_UNORDERED_USE_MOVE) || \
!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#ifdef BOOST_UNORDERED_FOA_TESTS #ifdef BOOST_UNORDERED_FOA_TESTS
using allocator_type = typename T::allocator_type; using allocator_type = typename T::allocator_type;
using value_type = using value_type =
@ -138,7 +129,6 @@ namespace move_tests {
} }
#else #else
BOOST_TEST_EQ(test::detail::tracker.count_allocations, 0u); BOOST_TEST_EQ(test::detail::tracker.count_allocations, 0u);
#endif
#endif #endif
test::check_container(y, v); test::check_container(y, v);
test::check_equivalent_keys(y); test::check_equivalent_keys(y);
@ -200,23 +190,8 @@ namespace move_tests {
test::random_values<T> v(25, generator); test::random_values<T> v(25, generator);
T y(create(v, count, hf, eq, al, 1.0), al); T y(create(v, count, hf, eq, al, 1.0), al);
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
BOOST_TEST(count == test::global_object_count); BOOST_TEST(count == test::global_object_count);
#elif defined(BOOST_HAS_NRVO)
BOOST_TEST(
static_cast<std::size_t>(
test::global_object_count.constructions - count.constructions) <=
(test::is_set<T>::value ? 1 : 2) *
(test::has_unique_keys<T>::value ? 25 : v.size()));
BOOST_TEST(count.instances == test::global_object_count.instances);
#else
BOOST_TEST(
static_cast<std::size_t>(
test::global_object_count.constructions - count.constructions) <=
(test::is_set<T>::value ? 2 : 4) *
(test::has_unique_keys<T>::value ? 25 : v.size()));
BOOST_TEST(count.instances == test::global_object_count.instances);
#endif
test::check_container(y, v); test::check_container(y, v);
BOOST_TEST(test::equivalent(y.hash_function(), hf)); BOOST_TEST(test::equivalent(y.hash_function(), hf));
BOOST_TEST(test::equivalent(y.key_eq(), eq)); BOOST_TEST(test::equivalent(y.key_eq(), eq));
@ -314,8 +289,7 @@ namespace move_tests {
#endif #endif
y = std::move(x); y = std::move(x);
#if defined(BOOST_UNORDERED_USE_MOVE) || \
!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#ifdef BOOST_UNORDERED_FOA_TESTS #ifdef BOOST_UNORDERED_FOA_TESTS
{ {
using value_type = using value_type =
@ -327,7 +301,6 @@ namespace move_tests {
} }
#else #else
BOOST_TEST_EQ(test::detail::tracker.count_allocations, 0u); BOOST_TEST_EQ(test::detail::tracker.count_allocations, 0u);
#endif
#endif #endif
test::check_container(y, v); test::check_container(y, v);
test::check_equivalent_keys(y); test::check_equivalent_keys(y);

View File

@ -21,12 +21,7 @@
namespace move_tests { namespace move_tests {
test::seed_t initialize_seed(98624); test::seed_t initialize_seed(98624);
#if defined(BOOST_UNORDERED_USE_MOVE) || \
!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#define BOOST_UNORDERED_TEST_MOVING 1 #define BOOST_UNORDERED_TEST_MOVING 1
#else
#define BOOST_UNORDERED_TEST_MOVING 0
#endif
template <class T> T empty(T*) { return T(); } template <class T> T empty(T*) { return T(); }
@ -463,8 +458,6 @@ namespace move_tests {
T x(std::move(y)); T x(std::move(y));
#if defined(BOOST_UNORDERED_USE_MOVE) || \
!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
BOOST_TEST(y.empty()); BOOST_TEST(y.empty());
BOOST_TEST(y.begin() == y.end()); BOOST_TEST(y.begin() == y.end());
@ -482,8 +475,6 @@ namespace move_tests {
#else #else
BOOST_TEST_EQ(y.bucket_count(), 0u); BOOST_TEST_EQ(y.bucket_count(), 0u);
BOOST_TEST_EQ(test::detail::tracker.count_allocations, num_allocs); BOOST_TEST_EQ(test::detail::tracker.count_allocations, num_allocs);
#endif
#endif #endif
fps[i](y, v); fps[i](y, v);
@ -532,8 +523,6 @@ namespace move_tests {
T x(empty(ptr)); T x(empty(ptr));
x = std::move(y); x = std::move(y);
#if defined(BOOST_UNORDERED_USE_MOVE) || \
!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
BOOST_TEST(y.empty()); BOOST_TEST(y.empty());
BOOST_TEST(y.begin() == y.end()); BOOST_TEST(y.begin() == y.end());
@ -551,8 +540,6 @@ namespace move_tests {
#else #else
BOOST_TEST_EQ(y.bucket_count(), 0u); BOOST_TEST_EQ(y.bucket_count(), 0u);
BOOST_TEST_EQ(test::detail::tracker.count_allocations, num_allocs); BOOST_TEST_EQ(test::detail::tracker.count_allocations, num_allocs);
#endif
#endif #endif
fps[i](y, v); fps[i](y, v);
@ -582,17 +569,10 @@ namespace move_tests {
bool b = boost::allocator_propagate_on_container_move_assignment< bool b = boost::allocator_propagate_on_container_move_assignment<
typename T::allocator_type>::type::value; typename T::allocator_type>::type::value;
if (b) { if (b) {
#if defined(BOOST_UNORDERED_USE_MOVE) || \
!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
BOOST_TEST(y.empty()); BOOST_TEST(y.empty());
BOOST_TEST(y.begin() == y.end()); BOOST_TEST(y.begin() == y.end());
BOOST_TEST_EQ(y.bucket_count(), 0u); BOOST_TEST_EQ(y.bucket_count(), 0u);
BOOST_TEST_EQ(test::detail::tracker.count_allocations, num_allocs); BOOST_TEST_EQ(test::detail::tracker.count_allocations, num_allocs);
#else
BOOST_TEST_NOT(y.empty());
BOOST_TEST(y.begin() != y.end());
#endif
} else { } else {
#ifdef BOOST_UNORDERED_FOA_TESTS #ifdef BOOST_UNORDERED_FOA_TESTS
BOOST_TEST(y.empty()); BOOST_TEST(y.empty());

View File

@ -210,24 +210,16 @@ namespace unnecessary_copy_tests {
typename T::value_type a; typename T::value_type a;
reset(); reset();
x.insert(std::move(a)); x.insert(std::move(a));
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
COPY_COUNT(1);
MOVE_COUNT(0);
#else
COPY_COUNT(0); COPY_COUNT(0);
MOVE_COUNT(1); MOVE_COUNT(1);
#endif
typename T::value_type a2; typename T::value_type a2;
reset(); reset();
x.insert(std::move(a)); x.insert(std::move(a));
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
COPY_COUNT((x.size() == 2 ? 1 : 0));
MOVE_COUNT(0);
#else
COPY_COUNT(0); COPY_COUNT(0);
MOVE_COUNT((x.size() == 2 ? 1 : 0)); MOVE_COUNT((x.size() == 2 ? 1 : 0));
#endif
} }
boost::unordered_set<count_copies>* set; boost::unordered_set<count_copies>* set;
@ -254,11 +246,7 @@ namespace unnecessary_copy_tests {
reset(); reset();
T x; T x;
x.emplace(source<typename T::value_type>()); x.emplace(source<typename T::value_type>());
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
COPY_COUNT(1); COPY_COUNT(1);
#else
COPY_COUNT(2);
#endif
} }
UNORDERED_TEST( UNORDERED_TEST(
@ -266,7 +254,6 @@ namespace unnecessary_copy_tests {
UNORDERED_TEST( UNORDERED_TEST(
unnecessary_copy_emplace_rvalue_test, ((set)(multiset)(map)(multimap))) unnecessary_copy_emplace_rvalue_test, ((set)(multiset)(map)(multimap)))
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <class T> void unnecessary_copy_emplace_std_move_test(T*) template <class T> void unnecessary_copy_emplace_std_move_test(T*)
{ {
reset(); reset();
@ -281,7 +268,6 @@ namespace unnecessary_copy_tests {
UNORDERED_TEST( UNORDERED_TEST(
unnecessary_copy_emplace_std_move_test, ((set)(multiset)(map)(multimap))) unnecessary_copy_emplace_std_move_test, ((set)(multiset)(map)(multimap)))
#endif
template <class T> void unnecessary_copy_emplace_boost_move_test(T*) template <class T> void unnecessary_copy_emplace_boost_move_test(T*)
{ {
@ -291,14 +277,8 @@ namespace unnecessary_copy_tests {
COPY_COUNT(1); COPY_COUNT(1);
MOVE_COUNT_EXTRA(0, 1); MOVE_COUNT_EXTRA(0, 1);
x.emplace(std::move(a)); x.emplace(std::move(a));
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
COPY_COUNT(1); COPY_COUNT(1);
MOVE_COUNT(1); MOVE_COUNT(1);
#else
// Since std::pair isn't movable, move only works for sets.
COPY_COUNT_RANGE(1, 2);
MOVE_COUNT_RANGE(0, 1);
#endif
} }
UNORDERED_TEST( UNORDERED_TEST(
@ -329,13 +309,9 @@ namespace unnecessary_copy_tests {
COPY_COUNT(1); COPY_COUNT(1);
MOVE_COUNT_EXTRA(0, 1); MOVE_COUNT_EXTRA(0, 1);
x.emplace(std::move(a)); x.emplace(std::move(a));
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
COPY_COUNT(2);
MOVE_COUNT_EXTRA(0, 1);
#else
COPY_COUNT(1); COPY_COUNT(1);
MOVE_COUNT(1); MOVE_COUNT(1);
#endif
} }
UNORDERED_TEST( UNORDERED_TEST(