mirror of
https://github.com/boostorg/dynamic_bitset.git
synced 2026-01-19 16:22:10 +00:00
Clean up the swap() tests
Note that we still stated that references must be stable under a swap, which is no longer true after "Allow choosing the underlying container type".
This commit is contained in:
@@ -390,17 +390,16 @@ struct bitset_test
|
||||
BOOST_TEST( copy1 == rhs );
|
||||
BOOST_TEST( copy2 == lhs );
|
||||
|
||||
// references must be stable under a swap
|
||||
for ( typename Bitset::size_type i = 0; i < lhs.size(); ++i ) {
|
||||
Bitset b1( lhs );
|
||||
Bitset b2( rhs );
|
||||
typename Bitset::reference ref = b1[ i ];
|
||||
bool x = ref;
|
||||
const bool x = ref;
|
||||
if ( i < b2.size() )
|
||||
b2[ i ] = ! x; // make sure b2[i] is different
|
||||
b1.swap( b2 );
|
||||
BOOST_TEST( b2[ i ] == x ); // now it must be equal..
|
||||
b2.flip( i );
|
||||
BOOST_TEST( b2[ i ] == x ); // now it must be equal
|
||||
// b2.flip( i );
|
||||
// Since we transformed the Allocator parameter into
|
||||
// AllocatorOrContainer, the following is no longer true (think e.g.
|
||||
// of boost::container::small_vector).
|
||||
|
||||
Reference in New Issue
Block a user