No longer use boost::move()

Reason: We require C++11 now, so we can use std::move().
This commit is contained in:
Gennaro Prota
2025-09-11 12:18:37 +02:00
parent ae9703b119
commit e00d9b30ae
4 changed files with 8 additions and 10 deletions

View File

@@ -46,7 +46,7 @@ if (BOOST_DYNAMIC_BITSET_IS_ROOT)
# If BOOST_SRC_DIR is valid, fallback to find_package # If BOOST_SRC_DIR is valid, fallback to find_package
set(CMAKE_FOLDER Dependencies) set(CMAKE_FOLDER Dependencies)
set(BOOST_INCLUDE_LIBRARIES assert config container_hash core move throw_exception) set(BOOST_INCLUDE_LIBRARIES assert config container_hash core throw_exception)
set(BOOST_EXCLUDE_LIBRARIES dynamic_bitset) set(BOOST_EXCLUDE_LIBRARIES dynamic_bitset)
set(PREV_BUILD_TESTING ${BUILD_TESTING}) set(PREV_BUILD_TESTING ${BUILD_TESTING})
set(BUILD_TESTING OFF CACHE BOOL "Build the tests." FORCE) set(BUILD_TESTING OFF CACHE BOOL "Build the tests." FORCE)
@@ -62,7 +62,6 @@ target_link_libraries(boost_dynamic_bitset
Boost::config Boost::config
Boost::container_hash Boost::container_hash
Boost::core Boost::core
Boost::move
Boost::throw_exception Boost::throw_exception
) )

View File

@@ -10,7 +10,6 @@ constant boost_dependencies :
/boost/config//boost_config /boost/config//boost_config
/boost/container_hash//boost_container_hash /boost/container_hash//boost_container_hash
/boost/core//boost_core /boost/core//boost_core
/boost/move//boost_move
/boost/throw_exception//boost_throw_exception ; /boost/throw_exception//boost_throw_exception ;
project /boost/dynamic_bitset project /boost/dynamic_bitset

View File

@@ -21,7 +21,6 @@
#include "boost/core/no_exceptions_support.hpp" #include "boost/core/no_exceptions_support.hpp"
#include "boost/dynamic_bitset/detail/lowest_bit.hpp" #include "boost/dynamic_bitset/detail/lowest_bit.hpp"
#include "boost/functional/hash/hash.hpp" #include "boost/functional/hash/hash.hpp"
#include "boost/move/move.hpp"
#include "boost/throw_exception.hpp" #include "boost/throw_exception.hpp"
#include <algorithm> #include <algorithm>
#include <climits> #include <climits>
@@ -29,6 +28,7 @@
#include <iterator> #include <iterator>
#include <ostream> #include <ostream>
#include <stdexcept> #include <stdexcept>
#include <utility>
#ifndef BOOST_NO_STD_LOCALE #ifndef BOOST_NO_STD_LOCALE
# include <locale> # include <locale>
@@ -644,7 +644,7 @@ operator=( const dynamic_bitset< Block, AllocatorOrContainer > & b )
template< typename Block, typename AllocatorOrContainer > template< typename Block, typename AllocatorOrContainer >
dynamic_bitset< Block, AllocatorOrContainer >:: dynamic_bitset< Block, AllocatorOrContainer >::
dynamic_bitset( dynamic_bitset< Block, AllocatorOrContainer > && b ) dynamic_bitset( dynamic_bitset< Block, AllocatorOrContainer > && b )
: m_bits( boost::move( b.m_bits ) ), m_num_bits( boost::move( b.m_num_bits ) ) : m_bits( std::move( b.m_bits ) ), m_num_bits( std::move( b.m_num_bits ) )
{ {
// Required so that BOOST_ASSERT(m_check_invariants()); works. // Required so that BOOST_ASSERT(m_check_invariants()); works.
BOOST_ASSERT( ( b.m_bits = buffer_type( get_allocator() ) ).empty() ); BOOST_ASSERT( ( b.m_bits = buffer_type( get_allocator() ) ).empty() );
@@ -660,8 +660,8 @@ operator=( dynamic_bitset< Block, AllocatorOrContainer > && b )
return *this; return *this;
} }
m_bits = boost::move( b.m_bits ); m_bits = std::move( b.m_bits );
m_num_bits = boost::move( b.m_num_bits ); m_num_bits = std::move( b.m_num_bits );
// Required so that BOOST_ASSERT(m_check_invariants()); works. // Required so that BOOST_ASSERT(m_check_invariants()); works.
BOOST_ASSERT( ( b.m_bits = buffer_type( get_allocator() ) ).empty() ); BOOST_ASSERT( ( b.m_bits = buffer_type( get_allocator() ) ).empty() );
b.m_num_bits = 0; b.m_num_bits = 0;

View File

@@ -359,7 +359,7 @@ struct bitset_test
move_constructor( const Bitset & b ) move_constructor( const Bitset & b )
{ {
Bitset copy( b ); Bitset copy( b );
Bitset b2( boost::move( copy ) ); Bitset b2( std::move( copy ) );
BOOST_TEST( b2 == b ); BOOST_TEST( b2 == b );
} }
@@ -369,8 +369,8 @@ struct bitset_test
{ {
Bitset b( lhs ); Bitset b( lhs );
Bitset c( rhs ); Bitset c( rhs );
b = boost::move( c ); b = std::move( c );
b = boost::move( b ); // self assignment check b = std::move( b ); // self assignment check
BOOST_TEST( b == rhs ); BOOST_TEST( b == rhs );
} }