/*
This file is a part of libcds - Concurrent Data Structures library
- (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+ (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
data.reserve( kSize );
indices.reserve( kSize );
for ( size_t key = 0; key < kSize; ++key ) {
- data.push_back( value_type( static_cast<int>(key)) );
+ data.push_back( value_type( static_cast<int>(key)));
indices.push_back( key );
}
shuffle( indices.begin(), indices.end());
EXPECT_TRUE( s.empty());
EXPECT_CONTAINER_SIZE( s, 0 );
+
+ // erase_at()
+ for ( auto& i : data ) {
+ EXPECT_TRUE( s.insert( i ));
+ }
+ EXPECT_FALSE( s.empty());
+ EXPECT_CONTAINER_SIZE( s, nSetSize );
+
+ for ( auto it = s.begin(); it != s.end(); ++it ) {
+ EXPECT_TRUE( s.erase_at( it ));
+ EXPECT_FALSE( s.erase_at( it ));
+ }
+
+ EXPECT_TRUE( s.empty());
+ EXPECT_CONTAINER_SIZE( s, 0 );
}
};