Replace boost::move with std::move

This commit is contained in:
Christian Mazakas
2023-09-27 11:44:44 -07:00
parent 11322de29f
commit adb91ac06d
13 changed files with 110 additions and 110 deletions
+15 -15
View File
@@ -191,10 +191,10 @@ template <class X, class T> void container_test(X& r, T const&)
node_type n1;
node_type n2(rvalue_default<node_type>());
#if !BOOST_COMP_GNUC || BOOST_COMP_GNUC >= BOOST_VERSION_NUMBER(4, 8, 0)
TEST_NOEXCEPT_EXPR(node_type(boost::move(n1)));
TEST_NOEXCEPT_EXPR(node_type(std::move(n1)));
#endif
node_type n3;
n3 = boost::move(n2);
n3 = std::move(n2);
n1.swap(n3);
swap(n1, n3);
// TODO: noexcept for swap?
@@ -350,7 +350,7 @@ template <class X, class Key> void unordered_set_test(X& r, Key const&)
test::minimal::constructor_param v;
Key k_lvalue(v);
r.emplace(boost::move(k_lvalue));
r.emplace(std::move(k_lvalue));
node_type n1 = r.extract(r.begin());
test::check_return_type<value_type>::equals_ref(n1.value());
#endif
@@ -493,11 +493,11 @@ void unordered_map_test(X& r, Key const& k, T const& v)
test::check_return_type<key_type>::equals_ref(n1.key());
test::check_return_type<T>::equals_ref(n1.mapped());
node_type n2 = boost::move(n1);
r.insert(boost::move(n2));
node_type n2 = std::move(n1);
r.insert(std::move(n2));
r.insert(r.extract(r.begin()));
n2 = r.extract(r.begin());
r.insert(r.begin(), boost::move(n2));
r.insert(r.begin(), std::move(n2));
r.insert(r.end(), r.extract(r.begin()));
node_type n = r.extract(r.begin());
@@ -530,11 +530,11 @@ template <class X, class T> void unordered_unique_test(X& r, T const& t)
// TODO;
// boost::function_requires<
// boost::MoveConstructibleConcept<insert_return_type>
// std::moveConstructibleConcept<insert_return_type>
// >();
// TODO;
// boost::function_requires<
// boost::MoveAssignableConcept<insert_return_type>
// std::moveAssignableConcept<insert_return_type>
// >();
boost::function_requires<
boost::DefaultConstructibleConcept<insert_return_type> >();
@@ -881,9 +881,9 @@ void unordered_movable_test(X& x, Key& k, T& /* t */, Hash& hf, Pred& eq)
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
X x1(rvalue_default<X>());
X x2(boost::move(x1));
X x2(std::move(x1));
x1 = rvalue_default<X>();
x2 = boost::move(x1);
x2 = std::move(x1);
#endif
X a;
@@ -922,19 +922,19 @@ void unordered_movable_test(X& x, Key& k, T& /* t */, Hash& hf, Pred& eq)
test::check_return_type<iterator>::equals(a.emplace_hint(q, v));
T v1(v);
a.emplace(boost::move(v1));
a.emplace(std::move(v1));
T v2(v);
a.insert(boost::move(v2));
a.insert(std::move(v2));
T v3(v);
test::check_return_type<iterator>::equals(a.emplace_hint(q, boost::move(v3)));
test::check_return_type<iterator>::equals(a.emplace_hint(q, std::move(v3)));
T v4(v);
test::check_return_type<iterator>::equals(a.insert(q, boost::move(v4)));
test::check_return_type<iterator>::equals(a.insert(q, std::move(v4)));
a.insert(i, j);
X a10;
T v5(v);
a10.insert(boost::move(v5));
a10.insert(std::move(v5));
q = a10.cbegin();
#ifdef BOOST_UNORDERED_FOA_TESTS
test::check_return_type<iterator>::convertible(a10.erase(q));
+4 -4
View File
@@ -75,7 +75,7 @@ namespace insert_tests {
float b = x.max_load_factor();
typename X::value_type value = *it;
std::pair<iterator, bool> r1 = x.insert(boost::move(value));
std::pair<iterator, bool> r1 = x.insert(std::move(value));
std::pair<typename ordered::iterator, bool> r2 = tracker.insert(*it);
BOOST_TEST(r1.second == r2.second);
@@ -137,7 +137,7 @@ namespace insert_tests {
float b = x.max_load_factor();
typename X::value_type value = *it;
typename X::iterator r1 = x.insert(boost::move(value));
typename X::iterator r1 = x.insert(std::move(value));
typename test::ordered<X>::iterator r2 = tracker.insert(*it);
BOOST_TEST(*r1 == *r2);
@@ -258,7 +258,7 @@ namespace insert_tests {
float b = x.max_load_factor();
typename X::value_type value = *it;
pos = x.insert(pos, boost::move(value));
pos = x.insert(pos, std::move(value));
tracker_iterator r2 = tracker.insert(tracker.begin(), *it);
BOOST_TEST(*pos == *r2);
tracker.compare_key(x, *it);
@@ -484,7 +484,7 @@ namespace insert_tests {
float b = x.max_load_factor();
typename X::value_type value = *it;
x.emplace(boost::move(value));
x.emplace(std::move(value));
tracker.insert(*it);
tracker.compare_key(x, *it);
+3 -3
View File
@@ -313,7 +313,7 @@ namespace move_tests {
BOOST_TEST_EQ(test::detail::tracker.count_allocations, 0u);
#endif
y = boost::move(x);
y = std::move(x);
#if defined(BOOST_UNORDERED_USE_MOVE) || \
!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#ifdef BOOST_UNORDERED_FOA_TESTS
@@ -357,7 +357,7 @@ namespace move_tests {
x.insert(v.begin(), v.end());
test::object_count count = test::global_object_count;
y = boost::move(x);
y = std::move(x);
if (BOOST_UNORDERED_TEST_MOVING && allocator_type::is_propagate_on_move) {
BOOST_TEST(count == test::global_object_count);
}
@@ -391,7 +391,7 @@ namespace move_tests {
test::object_count count1 = test::global_object_count;
T y(v1.begin(), v1.end(), 0, hf, eq, al1);
y = boost::move(x);
y = std::move(x);
test::object_count count2 = test::global_object_count;
+8 -8
View File
@@ -119,12 +119,12 @@ static void failed_insertion_with_hint()
typename Set<int>::node_type nh = src.extract(10);
BOOST_TEST(dst.insert(dst.find(10), boost::move(nh)) == dst.find(10));
BOOST_TEST(dst.insert(dst.find(10), std::move(nh)) == dst.find(10));
BOOST_TEST(nh);
BOOST_TEST(!nh.empty());
BOOST_TEST(nh.value() == 10);
BOOST_TEST(dst.insert(dst.find(20), boost::move(nh)) == dst.find(10));
BOOST_TEST(dst.insert(dst.find(20), std::move(nh)) == dst.find(10));
BOOST_TEST(nh);
BOOST_TEST(!nh.empty());
BOOST_TEST(nh.value() == 10);
@@ -144,14 +144,14 @@ static void failed_insertion_with_hint()
dst.emplace(20, 2);
typename Map<int, int>::node_type nh = src.extract(10);
BOOST_TEST(dst.insert(dst.find(10), boost::move(nh)) == dst.find(10));
BOOST_TEST(dst.insert(dst.find(10), std::move(nh)) == dst.find(10));
BOOST_TEST(nh);
BOOST_TEST(!nh.empty());
BOOST_TEST(nh.key() == 10);
BOOST_TEST(nh.mapped() == 30);
BOOST_TEST(dst[10] == 20);
BOOST_TEST(dst.insert(dst.find(20), boost::move(nh)) == dst.find(10));
BOOST_TEST(dst.insert(dst.find(20), std::move(nh)) == dst.find(10));
BOOST_TEST(nh);
BOOST_TEST(!nh.empty());
BOOST_TEST(nh.key() == 10);
@@ -195,7 +195,7 @@ template <typename Container> void node_handle_tests_impl(Container& c)
BOOST_TEST(!n2.empty());
node_handle_compare(n2, value);
node_type n3 = boost::move(n2);
node_type n3 = std::move(n2);
BOOST_TEST(n3);
BOOST_TEST(!n2);
node_handle_compare(n3, value);
@@ -203,16 +203,16 @@ template <typename Container> void node_handle_tests_impl(Container& c)
// Maybe by swapping and observing that the allocator is
// swapped rather than moved?
n1 = boost::move(n3);
n1 = std::move(n3);
BOOST_TEST(n1);
BOOST_TEST(!n3);
node_handle_compare(n1, value);
// Self move-assignment empties the node_handle.
n1 = boost::move(n1);
n1 = std::move(n1);
BOOST_TEST(!n1);
n3 = boost::move(n3);
n3 = std::move(n3);
BOOST_TEST(!n3);
typename Container::value_type value1 = *c.begin();
+3 -3
View File
@@ -255,7 +255,7 @@ namespace noexcept_tests {
try {
throwing_test_exception = true;
X x2 = boost::move(x1);
X x2 = std::move(x1);
BOOST_TEST(x2.size() == 2);
BOOST_TEST(*x2.begin() == 10 || *x2.begin() == 50);
BOOST_TEST(have_is_nothrow_move);
@@ -287,7 +287,7 @@ namespace noexcept_tests {
try {
throwing_test_exception = true;
x2 = boost::move(x1);
x2 = std::move(x1);
BOOST_TEST(x2.size() == 2);
BOOST_TEST(*x2.begin() == 10 || *x2.begin() == 50);
BOOST_TEST(have_is_nothrow_move_assign);
@@ -316,7 +316,7 @@ namespace noexcept_tests {
try {
throwing_test_exception = true;
x1 = boost::move(x2);
x1 = std::move(x2);
BOOST_TEST(x1.size() == 100);
BOOST_TEST(have_is_nothrow_move_assign);
} catch (test_exception) {
+7 -7
View File
@@ -322,7 +322,7 @@ namespace move_tests {
{
T x(v.begin(), v.end());
std::size_t const size = x.size();
y = boost::move(x);
y = std::move(x);
BOOST_TEST_GE(y.size(), size);
BOOST_TEST_EQ(y.size(),
static_cast<typename T::size_type>(std::distance(y.begin(), y.end())));
@@ -393,7 +393,7 @@ namespace move_tests {
template <class T>
static void double_move_construct(T& y, test::random_values<T> const&)
{
T x = boost::move(y);
T x = std::move(y);
x.clear();
BOOST_TEST_EQ(y.size(),
static_cast<typename T::size_type>(std::distance(y.begin(), y.end())));
@@ -405,7 +405,7 @@ namespace move_tests {
static void double_move_assign(T& y, test::random_values<T> const&)
{
T x;
x = boost::move(y);
x = std::move(y);
x.clear();
BOOST_TEST_EQ(y.size(),
static_cast<typename T::size_type>(std::distance(y.begin(), y.end())));
@@ -461,7 +461,7 @@ namespace move_tests {
unsigned num_allocs = test::detail::tracker.count_allocations;
(void)num_allocs;
T x(boost::move(y));
T x(std::move(y));
#if defined(BOOST_UNORDERED_USE_MOVE) || \
!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
@@ -503,7 +503,7 @@ namespace move_tests {
test::random_values<T> v(1000, generator);
test::object_count count;
T y(v.begin(), v.end(), 0, hf, eq, al1);
T x(boost::move(y), al2);
T x(std::move(y), al2);
#ifdef BOOST_UNORDERED_FOA_TESTS
BOOST_TEST(y.empty());
@@ -530,7 +530,7 @@ namespace move_tests {
(void)num_allocs;
T x(empty(ptr));
x = boost::move(y);
x = std::move(y);
#if defined(BOOST_UNORDERED_USE_MOVE) || \
!defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
@@ -577,7 +577,7 @@ namespace move_tests {
(void)num_allocs;
T x(al2);
x = boost::move(y);
x = std::move(y);
bool b = boost::allocator_propagate_on_container_move_assignment<
typename T::allocator_type>::type::value;
+4 -4
View File
@@ -1845,7 +1845,7 @@ template <class UnorderedSet> void test_set_transparent_extract(UnorderedSet*)
BOOST_TEST_EQ(nh.value(), 0);
BOOST_TEST_EQ(count, set_size - 3);
set.insert(boost::move(nh));
set.insert(std::move(nh));
nh = set.extract(1);
count = set.count(1);
@@ -1853,7 +1853,7 @@ template <class UnorderedSet> void test_set_transparent_extract(UnorderedSet*)
BOOST_TEST_EQ(nh.value(), 1);
BOOST_TEST_EQ(count, 0u);
set.insert(boost::move(nh));
set.insert(std::move(nh));
nh = set.extract(1337);
BOOST_TEST(nh.empty());
@@ -1897,7 +1897,7 @@ void test_set_non_transparent_extract(UnorderedSet*)
BOOST_TEST_EQ(nh.value(), 0);
BOOST_TEST_EQ(count, set_size - 3);
set.insert(boost::move(nh));
set.insert(std::move(nh));
nh = set.extract(1);
++key_count;
@@ -1909,7 +1909,7 @@ void test_set_non_transparent_extract(UnorderedSet*)
BOOST_TEST_EQ(nh.value(), 1);
BOOST_TEST_EQ(count, 0u);
set.insert(boost::move(nh));
set.insert(std::move(nh));
nh = set.extract(1337);
++key_count;
+10 -10
View File
@@ -189,13 +189,13 @@ namespace unnecessary_copy_tests {
T x;
typename T::value_type a;
reset();
x.insert(boost::move(a));
x.insert(std::move(a));
COPY_COUNT(0);
MOVE_COUNT(1);
typename T::value_type a2;
reset();
x.insert(boost::move(a));
x.insert(std::move(a));
COPY_COUNT(0);
MOVE_COUNT((x.size() == 2 ? 1 : 0));
}
@@ -209,7 +209,7 @@ namespace unnecessary_copy_tests {
T x;
typename T::value_type a;
reset();
x.insert(boost::move(a));
x.insert(std::move(a));
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
COPY_COUNT(1);
MOVE_COUNT(0);
@@ -220,7 +220,7 @@ namespace unnecessary_copy_tests {
typename T::value_type a2;
reset();
x.insert(boost::move(a));
x.insert(std::move(a));
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
COPY_COUNT((x.size() == 2 ? 1 : 0));
MOVE_COUNT(0);
@@ -290,7 +290,7 @@ namespace unnecessary_copy_tests {
typename T::value_type a;
COPY_COUNT(1);
MOVE_COUNT_EXTRA(0, 1);
x.emplace(boost::move(a));
x.emplace(std::move(a));
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
COPY_COUNT(1);
MOVE_COUNT(1);
@@ -311,7 +311,7 @@ namespace unnecessary_copy_tests {
typename T::value_type a;
COPY_COUNT(1);
MOVE_COUNT(0);
x.emplace(boost::move(a));
x.emplace(std::move(a));
COPY_COUNT(1);
MOVE_COUNT(1);
}
@@ -328,7 +328,7 @@ namespace unnecessary_copy_tests {
typename T::value_type a;
COPY_COUNT(1);
MOVE_COUNT_EXTRA(0, 1);
x.emplace(boost::move(a));
x.emplace(std::move(a));
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
COPY_COUNT(2);
MOVE_COUNT_EXTRA(0, 1);
@@ -393,7 +393,7 @@ namespace unnecessary_copy_tests {
// No move should take place.
reset();
x.emplace(boost::move(a));
x.emplace(std::move(a));
COPY_COUNT(0);
MOVE_COUNT(0);
@@ -457,7 +457,7 @@ namespace unnecessary_copy_tests {
#if BOOST_WORKAROUND(BOOST_MSVC, == 1700)
// This is a little odd, Visual C++ 11 seems to move the pair, which
// results in one copy (for the const key) and one move (for the
// non-const mapped value). Since 'emplace(boost::move(a))' (see below)
// non-const mapped value). Since 'emplace(std::move(a))' (see below)
// has the normal result, it must be some odd consequence of how
// Visual C++ 11 handles calling move for default arguments.
COPY_COUNT(3);
@@ -504,7 +504,7 @@ namespace unnecessary_copy_tests {
// No move should take place.
// (since a is already in the container)
reset();
x.emplace(boost::move(a));
x.emplace(std::move(a));
COPY_COUNT(0);
MOVE_COUNT(0);