From 4cd18271045c38cce342d04af4f5b8ddb0d1d957 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Wed, 30 Aug 2023 12:06:44 -0700 Subject: [PATCH] Remove BOOST_RV_REF --- include/boost/unordered/detail/fca.hpp | 5 +- .../boost/unordered/detail/implementation.hpp | 37 +------ include/boost/unordered/unordered_map.hpp | 102 +++++++----------- include/boost/unordered/unordered_set.hpp | 65 ++++------- test/objects/minimal.hpp | 4 +- test/objects/test.hpp | 4 +- test/unordered/insert_tests.cpp | 2 +- test/unordered/noexcept_tests.cpp | 12 +-- test/unordered/unnecessary_copy_tests.cpp | 4 +- 9 files changed, 72 insertions(+), 163 deletions(-) diff --git a/include/boost/unordered/detail/fca.hpp b/include/boost/unordered/detail/fca.hpp index 986b9723..7104b19b 100644 --- a/include/boost/unordered/detail/fca.hpp +++ b/include/boost/unordered/detail/fca.hpp @@ -569,7 +569,7 @@ namespace boost { ~grouped_bucket_array() { this->deallocate(); } - grouped_bucket_array(BOOST_RV_REF(grouped_bucket_array) other) noexcept + grouped_bucket_array(grouped_bucket_array&& other) noexcept : empty_value( empty_init_t(), other.get_node_allocator()), size_index_(other.size_index_), @@ -583,8 +583,7 @@ namespace boost { other.groups = group_pointer(); } - grouped_bucket_array& operator=( - BOOST_RV_REF(grouped_bucket_array) other) noexcept + grouped_bucket_array& operator=(grouped_bucket_array&& other) noexcept { BOOST_ASSERT( this->get_node_allocator() == other.get_node_allocator()); diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index 61d3f31b..702121dd 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -440,7 +440,7 @@ namespace boost { public: optional() noexcept : has_value_(false) {} - optional(BOOST_RV_REF(optional) x) : has_value_(false) + optional(optional&& x) : has_value_(false) { if (x.has_value_) { move(x); @@ -452,7 +452,7 @@ namespace boost { new (value_.value_ptr()) T(x); } - optional& operator=(BOOST_RV_REF(optional) x) + optional& operator=(optional&& x) { destroy(); if (x.has_value_) { @@ -1106,34 +1106,6 @@ namespace boost { } }; - //////////////////////////////////////////////////////////////////////////// - // rvalue parameters when type can't be a BOOST_RV_REF(T) parameter - // e.g. for int - -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) -#define BOOST_UNORDERED_RV_REF(T) BOOST_RV_REF(T) -#else - struct please_ignore_this_overload - { - typedef please_ignore_this_overload type; - }; - - template struct rv_ref_impl - { - typedef BOOST_RV_REF(T) type; - }; - - template - struct rv_ref : boost::conditional::value, - boost::unordered::detail::rv_ref_impl, - please_ignore_this_overload>::type - { - }; - -#define BOOST_UNORDERED_RV_REF(T) \ - typename boost::unordered::detail::rv_ref::type -#endif - #if defined(BOOST_MSVC) #pragma warning(push) #pragma warning(disable : 4127) // conditional expression is constant @@ -2983,10 +2955,7 @@ namespace boost { static key_type const& extract(value_type const& v) { return v; } - static key_type const& extract(BOOST_UNORDERED_RV_REF(value_type) v) - { - return v; - } + static key_type const& extract(value_type&& v) { return v; } static no_key extract() { return no_key(); } diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index 31e43c3b..f6f6ec21 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -97,21 +97,18 @@ namespace boost { unordered_map(unordered_map const&); -#if defined(BOOST_UNORDERED_USE_MOVE) || \ - !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - unordered_map(BOOST_RV_REF(unordered_map) other) + unordered_map(unordered_map&& other) noexcept(table::nothrow_move_constructible) : table_(other.table_, boost::unordered::detail::move_tag()) { // The move is done in table_ } -#endif explicit unordered_map(allocator_type const&); unordered_map(unordered_map const&, allocator_type const&); - unordered_map(BOOST_RV_REF(unordered_map), allocator_type const&); + unordered_map(unordered_map&&, allocator_type const&); unordered_map(std::initializer_list, size_type = boost::unordered::detail::default_bucket_count, @@ -146,29 +143,12 @@ namespace boost { // Assign -#if defined(BOOST_UNORDERED_USE_MOVE) - unordered_map& operator=(BOOST_COPY_ASSIGN_REF(unordered_map) x) - { - table_.assign(x.table_, std::true_type()); - return *this; - } - - unordered_map& operator=(BOOST_RV_REF(unordered_map) x) - noexcept(value_allocator_traits::is_always_equal::value&& - boost::is_nothrow_move_assignable::value&& - boost::is_nothrow_move_assignable

::value) - { - table_.move_assign(x.table_, std::true_type()); - return *this; - } -#else unordered_map& operator=(unordered_map const& x) { table_.assign(x.table_, std::true_type()); return *this; } -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) unordered_map& operator=(unordered_map&& x) noexcept(value_allocator_traits::is_always_equal::value&& boost::is_nothrow_move_assignable::value&& @@ -177,8 +157,6 @@ namespace boost { table_.move_assign(x.table_, std::true_type()); return *this; } -#endif -#endif unordered_map& operator=(std::initializer_list); @@ -337,16 +315,15 @@ namespace boost { return this->emplace(x); } - std::pair insert(BOOST_RV_REF(value_type) x) + std::pair insert(value_type&& x) { return this->emplace(std::move(x)); } template - typename boost::enable_if< - boost::is_constructible, + typename boost::enable_if, std::pair >::type - insert(BOOST_RV_REF(P2) obj) + insert(P2&& obj) { return this->emplace(std::forward(obj)); } @@ -356,15 +333,15 @@ namespace boost { return this->emplace_hint(hint, x); } - iterator insert(const_iterator hint, BOOST_RV_REF(value_type) x) + iterator insert(const_iterator hint, value_type&& x) { return this->emplace_hint(hint, std::move(x)); } template - typename boost::enable_if< - boost::is_constructible, iterator>::type - insert(const_iterator hint, BOOST_RV_REF(P2) obj) + typename boost::enable_if, + iterator>::type + insert(const_iterator hint, P2&& obj) { return this->emplace_hint(hint, std::forward(obj)); } @@ -396,14 +373,14 @@ namespace boost { table_.node_alloc()); } - insert_return_type insert(BOOST_RV_REF(node_type) np) + insert_return_type insert(node_type&& np) { insert_return_type result; table_.move_insert_node_type_unique((node_type&)np, result); return result; } - iterator insert(const_iterator hint, BOOST_RV_REF(node_type) np) + iterator insert(const_iterator hint, node_type&& np) { return table_.move_insert_node_type_with_hint_unique(hint, np); } @@ -427,7 +404,7 @@ namespace boost { template std::pair try_emplace( - BOOST_RV_REF(key_type) k, BOOST_FWD_REF(Args)... args) + key_type&& k, BOOST_FWD_REF(Args)... args) { return table_.try_emplace_unique( std::move(k), std::forward(args)...); @@ -452,8 +429,8 @@ namespace boost { } template - iterator try_emplace(const_iterator hint, BOOST_RV_REF(key_type) k, - BOOST_FWD_REF(Args)... args) + iterator try_emplace( + const_iterator hint, key_type&& k, BOOST_FWD_REF(Args)... args) { return table_.try_emplace_hint_unique( hint, std::move(k), std::forward(args)...); @@ -478,7 +455,7 @@ namespace boost { template std::pair insert_or_assign( - BOOST_RV_REF(key_type) k, BOOST_FWD_REF(M) obj) + key_type&& k, BOOST_FWD_REF(M) obj) { return table_.insert_or_assign_unique( std::move(k), std::forward(obj)); @@ -502,7 +479,7 @@ namespace boost { template iterator insert_or_assign( - const_iterator, BOOST_RV_REF(key_type) k, BOOST_FWD_REF(M) obj) + const_iterator, key_type&& k, BOOST_FWD_REF(M) obj) { return table_ .insert_or_assign_unique(std::move(k), std::forward(obj)) @@ -653,7 +630,7 @@ namespace boost { } mapped_type& operator[](const key_type&); - mapped_type& operator[](BOOST_RV_REF(key_type)); + mapped_type& operator[](key_type&&); template typename boost::enable_if_c::value, @@ -884,22 +861,18 @@ namespace boost { unordered_multimap(unordered_multimap const&); -#if defined(BOOST_UNORDERED_USE_MOVE) || \ - !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - unordered_multimap(BOOST_RV_REF(unordered_multimap) other) + unordered_multimap(unordered_multimap&& other) noexcept(table::nothrow_move_constructible) : table_(other.table_, boost::unordered::detail::move_tag()) { // The move is done in table_ } -#endif explicit unordered_multimap(allocator_type const&); unordered_multimap(unordered_multimap const&, allocator_type const&); - unordered_multimap( - BOOST_RV_REF(unordered_multimap), allocator_type const&); + unordered_multimap(unordered_multimap&&, allocator_type const&); unordered_multimap(std::initializer_list, size_type = boost::unordered::detail::default_bucket_count, @@ -1008,15 +981,12 @@ namespace boost { iterator insert(value_type const& x) { return this->emplace(x); } - iterator insert(BOOST_RV_REF(value_type) x) - { - return this->emplace(std::move(x)); - } + iterator insert(value_type&& x) { return this->emplace(std::move(x)); } template - typename boost::enable_if< - boost::is_constructible, iterator>::type - insert(BOOST_RV_REF(P2) obj) + typename boost::enable_if, + iterator>::type + insert(P2&& obj) { return this->emplace(std::forward(obj)); } @@ -1026,15 +996,15 @@ namespace boost { return this->emplace_hint(hint, x); } - iterator insert(const_iterator hint, BOOST_RV_REF(value_type) x) + iterator insert(const_iterator hint, value_type&& x) { return this->emplace_hint(hint, std::move(x)); } template - typename boost::enable_if< - boost::is_constructible, iterator>::type - insert(const_iterator hint, BOOST_RV_REF(P2) obj) + typename boost::enable_if, + iterator>::type + insert(const_iterator hint, P2&& obj) { return this->emplace_hint(hint, std::forward(obj)); } @@ -1065,12 +1035,12 @@ namespace boost { return node_type(table_.extract_by_key_impl(k), table_.node_alloc()); } - iterator insert(BOOST_RV_REF(node_type) np) + iterator insert(node_type&& np) { return table_.move_insert_node_type_equiv(np); } - iterator insert(const_iterator hint, BOOST_RV_REF(node_type) np) + iterator insert(const_iterator hint, node_type&& np) { return table_.move_insert_node_type_with_hint_equiv(hint, np); } @@ -1423,7 +1393,7 @@ namespace boost { template unordered_map::unordered_map( - BOOST_RV_REF(unordered_map) other, allocator_type const& a) + unordered_map&& other, allocator_type const& a) : table_(other.table_, a, boost::unordered::detail::move_tag()) { table_.move_construct_buckets(other.table_); @@ -1732,7 +1702,7 @@ namespace boost { template typename unordered_map::mapped_type& - unordered_map::operator[](BOOST_RV_REF(key_type) k) + unordered_map::operator[](key_type&& k) { return table_.try_emplace_unique(std::move(k)).first->second; } @@ -1955,7 +1925,7 @@ namespace boost { template unordered_multimap::unordered_multimap( - BOOST_RV_REF(unordered_multimap) other, allocator_type const& a) + unordered_multimap&& other, allocator_type const& a) : table_(other.table_, a, boost::unordered::detail::move_tag()) { table_.move_construct_buckets(other.table_); @@ -2387,14 +2357,14 @@ namespace boost { } } - node_handle_map(BOOST_RV_REF(node_handle_map) n) noexcept + node_handle_map(node_handle_map&& n) noexcept : ptr_(n.ptr_), alloc_(std::move(n.alloc_)) { n.ptr_ = node_pointer(); } - node_handle_map& operator=(BOOST_RV_REF(node_handle_map) n) + node_handle_map& operator=(node_handle_map&& n) { BOOST_ASSERT(!alloc_.has_value() || boost::allocator_propagate_on_container_move_assignment< @@ -2479,14 +2449,14 @@ namespace boost { insert_return_type_map() : position(), inserted(false), node() {} - insert_return_type_map(BOOST_RV_REF(insert_return_type_map) x) noexcept + insert_return_type_map(insert_return_type_map&& x) noexcept : position(x.position), inserted(x.inserted), node(std::move(x.node)) { } - insert_return_type_map& operator=(BOOST_RV_REF(insert_return_type_map) x) + insert_return_type_map& operator=(insert_return_type_map&& x) { inserted = x.inserted; position = x.position; diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index 931e954e..2b709644 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -95,21 +95,18 @@ namespace boost { unordered_set(unordered_set const&); -#if defined(BOOST_UNORDERED_USE_MOVE) || \ - !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - unordered_set(BOOST_RV_REF(unordered_set) other) + unordered_set(unordered_set&& other) noexcept(table::nothrow_move_constructible) : table_(other.table_, boost::unordered::detail::move_tag()) { // The move is done in table_ } -#endif explicit unordered_set(allocator_type const&); unordered_set(unordered_set const&, allocator_type const&); - unordered_set(BOOST_RV_REF(unordered_set), allocator_type const&); + unordered_set(unordered_set&&, allocator_type const&); unordered_set(std::initializer_list, size_type = boost::unordered::detail::default_bucket_count, @@ -144,29 +141,12 @@ namespace boost { // Assign -#if defined(BOOST_UNORDERED_USE_MOVE) - unordered_set& operator=(BOOST_COPY_ASSIGN_REF(unordered_set) x) - { - table_.assign(x.table_, std::true_type()); - return *this; - } - - unordered_set& operator=(BOOST_RV_REF(unordered_set) x) - noexcept(value_allocator_traits::is_always_equal::value&& - boost::is_nothrow_move_assignable::value&& - boost::is_nothrow_move_assignable

::value) - { - table_.move_assign(x.table_, std::true_type()); - return *this; - } -#else unordered_set& operator=(unordered_set const& x) { table_.assign(x.table_, std::true_type()); return *this; } -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) unordered_set& operator=(unordered_set&& x) noexcept(value_allocator_traits::is_always_equal::value&& boost::is_nothrow_move_assignable::value&& @@ -175,8 +155,6 @@ namespace boost { table_.move_assign(x.table_, std::true_type()); return *this; } -#endif -#endif unordered_set& operator=(std::initializer_list); @@ -289,7 +267,7 @@ namespace boost { return this->emplace(x); } - std::pair insert(BOOST_UNORDERED_RV_REF(value_type) x) + std::pair insert(value_type&& x) { return this->emplace(std::move(x)); } @@ -308,7 +286,7 @@ namespace boost { return this->emplace_hint(hint, x); } - iterator insert(const_iterator hint, BOOST_UNORDERED_RV_REF(value_type) x) + iterator insert(const_iterator hint, value_type&& x) { return this->emplace_hint(hint, std::move(x)); } @@ -348,14 +326,14 @@ namespace boost { return node_type(table_.extract_by_key_impl(k), table_.node_alloc()); } - insert_return_type insert(BOOST_RV_REF(node_type) np) + insert_return_type insert(node_type&& np) { insert_return_type result; table_.move_insert_node_type_unique(np, result); return result; } - iterator insert(const_iterator hint, BOOST_RV_REF(node_type) np) + iterator insert(const_iterator hint, node_type&& np) { return table_.move_insert_node_type_with_hint_unique(hint, np); } @@ -677,22 +655,18 @@ namespace boost { unordered_multiset(unordered_multiset const&); -#if defined(BOOST_UNORDERED_USE_MOVE) || \ - !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - unordered_multiset(BOOST_RV_REF(unordered_multiset) other) + unordered_multiset(unordered_multiset&& other) noexcept(table::nothrow_move_constructible) : table_(other.table_, boost::unordered::detail::move_tag()) { // The move is done in table_ } -#endif explicit unordered_multiset(allocator_type const&); unordered_multiset(unordered_multiset const&, allocator_type const&); - unordered_multiset( - BOOST_RV_REF(unordered_multiset), allocator_type const&); + unordered_multiset(unordered_multiset&&, allocator_type const&); unordered_multiset(std::initializer_list, size_type = boost::unordered::detail::default_bucket_count, @@ -850,17 +824,14 @@ namespace boost { iterator insert(value_type const& x) { return this->emplace(x); } - iterator insert(BOOST_UNORDERED_RV_REF(value_type) x) - { - return this->emplace(std::move(x)); - } + iterator insert(value_type&& x) { return this->emplace(std::move(x)); } iterator insert(const_iterator hint, value_type const& x) { return this->emplace_hint(hint, x); } - iterator insert(const_iterator hint, BOOST_UNORDERED_RV_REF(value_type) x) + iterator insert(const_iterator hint, value_type&& x) { return this->emplace_hint(hint, std::move(x)); } @@ -891,12 +862,12 @@ namespace boost { return node_type(table_.extract_by_key_impl(k), table_.node_alloc()); } - iterator insert(BOOST_RV_REF(node_type) np) + iterator insert(node_type&& np) { return table_.move_insert_node_type_equiv(np); } - iterator insert(const_iterator hint, BOOST_RV_REF(node_type) np) + iterator insert(const_iterator hint, node_type&& np) { return table_.move_insert_node_type_with_hint_equiv(hint, np); } @@ -1214,7 +1185,7 @@ namespace boost { template unordered_set::unordered_set( - BOOST_RV_REF(unordered_set) other, allocator_type const& a) + unordered_set&& other, allocator_type const& a) : table_(other.table_, a, boost::unordered::detail::move_tag()) { table_.move_construct_buckets(other.table_); @@ -1616,7 +1587,7 @@ namespace boost { template unordered_multiset::unordered_multiset( - BOOST_RV_REF(unordered_multiset) other, allocator_type const& a) + unordered_multiset&& other, allocator_type const& a) : table_(other.table_, a, boost::unordered::detail::move_tag()) { table_.move_construct_buckets(other.table_); @@ -2014,14 +1985,14 @@ namespace boost { } } - node_handle_set(BOOST_RV_REF(node_handle_set) n) noexcept + node_handle_set(node_handle_set&& n) noexcept : ptr_(n.ptr_), alloc_(std::move(n.alloc_)) { n.ptr_ = node_pointer(); } - node_handle_set& operator=(BOOST_RV_REF(node_handle_set) n) + node_handle_set& operator=(node_handle_set&& n) { BOOST_ASSERT(!alloc_.has_value() || value_allocator_traits:: @@ -2098,14 +2069,14 @@ namespace boost { insert_return_type_set() : position(), inserted(false), node() {} - insert_return_type_set(BOOST_RV_REF(insert_return_type_set) x) noexcept + insert_return_type_set(insert_return_type_set&& x) noexcept : position(x.position), inserted(x.inserted), node(std::move(x.node)) { } - insert_return_type_set& operator=(BOOST_RV_REF(insert_return_type_set) x) + insert_return_type_set& operator=(insert_return_type_set&& x) { inserted = x.inserted; position = x.position; diff --git a/test/objects/minimal.hpp b/test/objects/minimal.hpp index 600621d8..a7936abc 100644 --- a/test/objects/minimal.hpp +++ b/test/objects/minimal.hpp @@ -171,8 +171,8 @@ namespace test { movable1(constructor_param const&) {} movable1() {} explicit movable1(movable_init) {} - movable1(BOOST_RV_REF(movable1)) {} - movable1& operator=(BOOST_RV_REF(movable1)) { return *this; } + movable1(movable1&&) {} + movable1& operator=(movable1&&) { return *this; } ~movable1() {} void dummy_member() const {} }; diff --git a/test/objects/test.hpp b/test/objects/test.hpp index 0ee91371..f0f804a9 100644 --- a/test/objects/test.hpp +++ b/test/objects/test.hpp @@ -106,7 +106,7 @@ namespace test { BOOST_TEST(x.tag1_ != -1); } - movable(BOOST_RV_REF(movable) x) + movable(movable&& x) : counted_object(x), tag1_(x.tag1_), tag2_(x.tag2_) { BOOST_TEST(x.tag1_ != -1); @@ -122,7 +122,7 @@ namespace test { return *this; } - movable& operator=(BOOST_RV_REF(movable) x) // Move assignment + movable& operator=(movable&& x) // Move assignment { BOOST_TEST(x.tag1_ != -1); tag1_ = x.tag1_; diff --git a/test/unordered/insert_tests.cpp b/test/unordered/insert_tests.cpp index c0d2cf93..ca4ef3ac 100644 --- a/test/unordered/insert_tests.cpp +++ b/test/unordered/insert_tests.cpp @@ -701,7 +701,7 @@ namespace insert_tests { pointer_constructible(int x_) : x(x_) {} pointer_constructible(pointer_constructible const& p) : x(p.x) {} pointer_constructible(pointer_constructible* const&) : x(-1) {} - pointer_constructible(BOOST_RV_REF(pointer_constructible*)) : x(-1) {} + pointer_constructible(pointer_constructible*&&) : x(-1) {} }; struct pointer_constructible_hash diff --git a/test/unordered/noexcept_tests.cpp b/test/unordered/noexcept_tests.cpp index 848c2358..af098e7a 100644 --- a/test/unordered/noexcept_tests.cpp +++ b/test/unordered/noexcept_tests.cpp @@ -62,7 +62,7 @@ namespace noexcept_tests { typedef boost::hash base; public: - hash_nothrow(BOOST_RV_REF(hash_nothrow)) noexcept(nothrow_move_construct) + hash_nothrow(hash_nothrow&&) noexcept(nothrow_move_construct) { if (!nothrow_move_construct) { test_throw("Move Constructor"); @@ -76,7 +76,7 @@ namespace noexcept_tests { test_throw("Assign"); return *this; } - hash_nothrow& operator=(BOOST_RV_REF(hash_nothrow)) + hash_nothrow& operator=(hash_nothrow&&) noexcept(nothrow_move_assign) { if (!nothrow_move_assign) { @@ -110,7 +110,7 @@ namespace noexcept_tests { typedef boost::hash base; public: - equal_to_nothrow(BOOST_RV_REF(equal_to_nothrow)) + equal_to_nothrow(equal_to_nothrow&&) noexcept(nothrow_move_construct) { if (!nothrow_move_construct) { @@ -125,7 +125,7 @@ namespace noexcept_tests { test_throw("Assign"); return *this; } - equal_to_nothrow& operator=(BOOST_RV_REF(equal_to_nothrow)) + equal_to_nothrow& operator=(equal_to_nothrow&&) noexcept(nothrow_move_assign) { if (!nothrow_move_assign) { @@ -367,7 +367,7 @@ template class allocator1 { BOOST_COPYABLE_AND_MOVABLE(allocator1) allocator1 operator=(BOOST_COPY_ASSIGN_REF(allocator1)); - allocator1 operator=(BOOST_RV_REF(allocator1)); + allocator1 operator=(allocator1&&); public: typedef T value_type; @@ -403,7 +403,7 @@ public: template allocator2(allocator2 const&) {} - allocator2& operator=(BOOST_RV_REF(allocator2)) { return *this; } + allocator2& operator=(allocator2&&) { return *this; } T* allocate(std::size_t n) { diff --git a/test/unordered/unnecessary_copy_tests.cpp b/test/unordered/unnecessary_copy_tests.cpp index 82a93714..e1f46ef6 100644 --- a/test/unordered/unnecessary_copy_tests.cpp +++ b/test/unordered/unnecessary_copy_tests.cpp @@ -56,7 +56,7 @@ namespace unnecessary_copy_tests { trace_op("Copy construct"); } - count_copies(BOOST_RV_REF(count_copies) x) : tag_(x.tag_), id_(++id_count) + count_copies(count_copies&& x) : tag_(x.tag_), id_(++id_count) { x.tag_ = -1; ++moves; @@ -72,7 +72,7 @@ namespace unnecessary_copy_tests { return *this; } - count_copies& operator=(BOOST_RV_REF(count_copies) p) // Move assignment + count_copies& operator=(count_copies&& p) // Move assignment { tag_ = p.tag_; ++moves;