/*
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/
template <typename Func>
bool operator()( Set& s, int key, Func f ) const
{
- return s.find( key, [&f]( typename Set::value_type& v, int key ) {
- cds_test::container_set::other_item oi( key );
+ return s.find( key, [&f]( typename Set::value_type& v, int k ) {
+ cds_test::container_set::other_item oi( k );
f( v, oi );
});
}
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_FALSE( updResult.second );
break;
case 1:
- ASSERT_TRUE( s.insert( i.key()) );
- ASSERT_FALSE( s.insert( i.key()) );
+ ASSERT_TRUE( s.insert( i.key()));
+ ASSERT_FALSE( s.insert( i.key()));
updResult = s.update( i.key(), []( bool bNew, value_type& val, int arg )
{
EXPECT_FALSE( bNew );
} ));
break;
case 6:
- ASSERT_TRUE( s.emplace( i.key()) );
+ ASSERT_TRUE( s.emplace( i.key()));
ASSERT_TRUE( s.find( i, []( value_type const& v, value_type const& arg )
{
EXPECT_EQ( v.key(), arg.key());
break;
case 7:
str = "Hello!";
- ASSERT_TRUE( s.emplace( i.key(), std::move( str )) );
+ ASSERT_TRUE( s.emplace( i.key(), std::move( str )));
EXPECT_TRUE( str.empty());
ASSERT_TRUE( s.find( i, []( value_type const& v, value_type const& arg )
{
int nKey = i.key() - 1;
switch ( idx % 6 ) {
case 0:
- ASSERT_TRUE( s.erase( i.key()) );
- ASSERT_FALSE( s.erase( i.key()) );
+ ASSERT_TRUE( s.erase( i.key()));
+ ASSERT_FALSE( s.erase( i.key()));
break;
case 1:
ASSERT_TRUE( s.erase( i ));