return do_remove(
key,
key_comparator(),
- [&f]( key_type const& key, mapped_type pVal, rcu_disposer& disp ) -> bool {
+ [&f]( key_type const& k, mapped_type pVal, rcu_disposer& disp ) -> bool {
assert( pVal );
- f( key, *pVal );
+ f( k, *pVal );
disp.dispose_value(pVal);
return true;
}
return do_remove(
key,
cds::opt::details::make_comparator_from_less<Less>(),
- [&f]( key_type const& key, mapped_type pVal, rcu_disposer& disp ) -> bool {
+ [&f]( key_type const& k, mapped_type pVal, rcu_disposer& disp ) -> bool {
assert( pVal );
- f( key, *pVal );
+ f( k, *pVal );
disp.dispose_value(pVal);
return true;
}
{
node_type * pNew;
- auto fnCreateNode = [&funcUpdate]( node_type * pNew ) {
- mapped_type pVal = funcUpdate( pNew );
+ auto fnCreateNode = [&funcUpdate]( node_type * pNode ) {
+ mapped_type pVal = funcUpdate( pNode );
assert( pVal != nullptr );
- pNew->m_pValue.store( pVal, memory_model::memory_order_release );
+ pNode->m_pValue.store( pVal, memory_model::memory_order_release );
};
static_if ( c_bRelaxedInsert ) {
template <typename Q, typename Compare, typename Func>
bool find_at( head_type& refHead, Q& val, Compare cmp, Func f )
{
- return base_class::find_at( &refHead, val, cmp, [&f](node_type& node, Q& val){ f( node_to_value(node), val ); });
+ return base_class::find_at( &refHead, val, cmp, [&f](node_type& node, Q& v){ f( node_to_value(node), v ); });
}
template <typename Q, typename Compare>
bool insert( Q const& val, Func f )
{
scoped_node_ptr sp( node_allocator().New( random_level(), val ));
- if ( base_class::insert( *sp.get(), [&f]( node_type& val ) { f( val.m_Value ); } )) {
+ if ( base_class::insert( *sp.get(), [&f]( node_type& v ) { f( v.m_Value ); } )) {
sp.release();
return true;
}
template <typename Q, typename Compare>
bool find_at( head_type& refHead, Q const& key, Compare cmp ) const
{
- return base_class::find_at( &refHead, key, cmp, [](node_type&, Q const &) {} );
+ return base_class::find_at( &refHead, key, cmp, [](node_type&, Q const&) {} );
}
template <typename Q, typename Compare, typename Func>
bool find_at( head_type& refHead, Q& val, Compare cmp, Func f ) const
{
- return base_class::find_at( &refHead, val, cmp, [&f](node_type& node, Q& val){ f( node_to_value(node), val ); });
+ return base_class::find_at( &refHead, val, cmp, [&f](node_type& node, Q& v){ f( node_to_value(node), v ); });
}
template <typename Q, typename Compare>
}
template <typename Stat>
- typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bucket )
+ typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* b )
{
- new (bucket) internal_bucket_type;
+ new (b) internal_bucket_type;
}
template <typename Stat>
- typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bucket )
+ typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* b )
{
- new (bucket) internal_bucket_type( m_Stat );
+ new (b) internal_bucket_type( m_Stat );
}
//@endcond
};
}
template <typename Stat>
- typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bucket )
+ typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* b )
{
- new (bucket) internal_bucket_type;
+ new (b) internal_bucket_type;
}
template <typename Stat>
- typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bucket )
+ typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* b )
{
- new (bucket) internal_bucket_type( m_Stat );
+ new (b) internal_bucket_type( m_Stat );
}
//@endcond
};
}
template <typename Stat>
- typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bucket )
+ typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bkt )
{
- new (bucket) internal_bucket_type;
+ new (bkt) internal_bucket_type;
}
template <typename Stat>
- typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bucket )
+ typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bkt )
{
- new (bucket) internal_bucket_type( m_Stat );
+ new (bkt) internal_bucket_type( m_Stat );
}
//@endcond
};
}
template <typename Stat>
- typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bucket )
+ typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* b )
{
- new (bucket) internal_bucket_type;
+ new (b) internal_bucket_type;
}
template <typename Stat>
- typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bucket )
+ typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* b )
{
- new (bucket) internal_bucket_type( m_Stat );
+ new (b) internal_bucket_type( m_Stat );
}
template <typename List, typename... Args>
private:
//@cond
template <typename Stat>
- typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bucket )
+ typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* b )
{
- new (bucket) internal_bucket_type;
+ new (b) internal_bucket_type;
}
template <typename Stat>
- typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bucket )
+ typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* b )
{
- new (bucket) internal_bucket_type( m_Stat );
+ new (b) internal_bucket_type( m_Stat );
}
const_iterator get_const_begin() const
}
template <typename Stat>
- typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bucket )
+ typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bkt )
{
- new (bucket) internal_bucket_type;
+ new (bkt) internal_bucket_type;
}
template <typename Stat>
- typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bucket )
+ typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bkt )
{
- new (bucket) internal_bucket_type( m_Stat );
+ new (bkt) internal_bucket_type( m_Stat );
}
const_iterator get_const_begin() const
bool insert( Q const& val, Func f )
{
scoped_node_ptr sp( node_allocator().New( random_level(), val ));
- if ( base_class::insert( *sp.get(), [&f]( node_type& val ) { f( val.m_Value ); } )) {
+ if ( base_class::insert( *sp.get(), [&f]( node_type& v ) { f( v.m_Value ); } )) {
sp.release();
return true;
}
template <typename Q, typename Func>
bool find_( Q& val, Func f )
{
- return base_class::find( val, [&f]( node_type& item, Q& val ) { f( item.m_Value, val ); } );
+ return base_class::find( val, [&f]( node_type& item, Q& v ) { f( item.m_Value, v ); } );
}
template <typename Q>
{
CDS_UNUSED( pred );
return base_class::find_with( val, typename maker::template predicate_wrapper<Less>::type(),
- [&f]( node_type& item, Q& val ) { f( item.m_Value, val ); } );
+ [&f]( node_type& item, Q& v ) { f( item.m_Value, v ); } );
}
template <typename Q, typename Less>
template <typename Q, typename Func>
bool find_( Q& val, Func f )
{
- return base_class::find( val, [&f]( node_type& item, Q& val ) { f(item.m_Value, val) ; } );
+ return base_class::find( val, [&f]( node_type& item, Q& v ) { f(item.m_Value, v) ; } );
}
template <typename Q, typename Less, typename Func>
{
CDS_UNUSED( pred );
return base_class::find_with( val, typename maker::template predicate_wrapper<Less>::type(),
- [&f]( node_type& item, Q& val ) { f(item.m_Value, val) ; } );
+ [&f]( node_type& item, Q& v ) { f(item.m_Value, v) ; } );
}
template <typename Q>
return p;
// iterate the cache
- for ( auto& cell : m_cache ) {
- p = cell.load( atomics::memory_order_relaxed );
- if ( p && cell.compare_exchange_weak( p, nullptr, atomics::memory_order_acquire, atomics::memory_order_relaxed ))
+ for ( auto& item : m_cache ) {
+ p = item.load( atomics::memory_order_relaxed );
+ if ( p && item.compare_exchange_weak( p, nullptr, atomics::memory_order_acquire, atomics::memory_order_relaxed ))
return p;
}
retry:
tree_node * p = bRight
? res.guards.protect( search_result::Guard_Leaf, pParent->m_pRight,
- []( tree_node * p ) -> internal_node* { return static_cast<internal_node *>(p);})
+ []( tree_node * pn ) -> internal_node* { return static_cast<internal_node *>(pn);})
: res.guards.protect( search_result::Guard_Leaf, pParent->m_pLeft,
- []( tree_node * p ) -> internal_node* { return static_cast<internal_node *>(p);});
+ []( tree_node * pn ) -> internal_node* { return static_cast<internal_node *>(pn);});
// If we use member hook, data node pointer != internal node pointer
// So, we need protect the child twice: as internal node and as data node
// and then analyze what kind of node we have
tree_node * pVal = bRight
? res.guards.protect( search_result::Guard_temporary, pParent->m_pRight,
- []( tree_node * p ) -> value_type* { return node_traits::to_value_ptr( static_cast<leaf_node *>(p));} )
+ []( tree_node * pn ) -> value_type* { return node_traits::to_value_ptr( static_cast<leaf_node *>(pn));} )
: res.guards.protect( search_result::Guard_temporary, pParent->m_pLeft,
- []( tree_node * p ) -> value_type* { return node_traits::to_value_ptr( static_cast<leaf_node *>(p));} );
+ []( tree_node * pn ) -> value_type* { return node_traits::to_value_ptr( static_cast<leaf_node *>(pn));} );
// child node is guarded
// See whether pParent->m_pUpdate has not been changed
\p Equal functor has the interface like \p std::equal_to.
*/
template <typename Q, typename Equal, typename Func, bool Sort = c_bSort>
- typename std::enable_if<!Sort, bool>::type find_with( Q& key, Equal equal, Func f )
+ typename std::enable_if<!Sort, bool>::type find_with( Q& key, Equal eq, Func f )
{
- CDS_UNUSED( equal );
- return find_at( &m_Head, key, equal, f );
+ //CDS_UNUSED( eq );
+ return find_at( &m_Head, key, eq, f );
}
//@cond
template <typename Q, typename Less, typename Func, bool Sort = c_bSort>
}
template <typename Q, typename Equal, typename Func, bool Sort = c_bSort>
- typename std::enable_if<!Sort, bool>::type find_with( Q const& key, Equal equal, Func f )
+ typename std::enable_if<!Sort, bool>::type find_with( Q const& key, Equal eq, Func f )
{
- CDS_UNUSED( equal );
- return find_at( &m_Head, key, equal, f );
+ //CDS_UNUSED( eq );
+ return find_at( &m_Head, key, eq, f );
}
//@endcond
\p Equal functor has the interface like \p std::equal_to.
*/
template <typename Q, typename Equal, bool Sort = c_bSort>
- typename std::enable_if<!Sort, value_type *>::type contains( Q const& key, Equal equal )
+ typename std::enable_if<!Sort, value_type *>::type contains( Q const& key, Equal eq )
{
- return find_at( &m_Head, key, equal );
+ return find_at( &m_Head, key, eq );
}
//@cond
template <typename Q, typename Equal, bool Sort = c_bSort>
CDS_DEPRECATED("deprecated, use contains()")
- typename std::enable_if<!Sort, value_type *>::type find_with( Q const& key, Equal equal )
+ typename std::enable_if<!Sort, value_type *>::type find_with( Q const& key, Equal eq )
{
- return contains( key, equal );
+ return contains( key, eq );
}
//@endcond
}
template <typename Stat>
- typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type * bucket )
+ typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type * b )
{
- new (bucket) internal_bucket_type;
+ new (b) internal_bucket_type;
}
template <typename Stat>
- typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type * bucket )
+ typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type * b )
{
- new (bucket) internal_bucket_type( m_Stat );
+ new (b) internal_bucket_type( m_Stat );
}
/// Calculates hash value of \p key
private:
//@cond
template <typename Stat>
- typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type * bucket )
+ typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type * b )
{
- new (bucket) internal_bucket_type;
+ new (b) internal_bucket_type;
}
template <typename Stat>
- typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type * bucket )
+ typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type * b )
{
- new (bucket) internal_bucket_type( m_Stat );
+ new (b) internal_bucket_type( m_Stat );
}
//@endcond
};
private:
//@cond
template <typename Stat>
- typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type * bucket )
+ typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type * bkt )
{
- new (bucket) internal_bucket_type;
+ new (bkt) internal_bucket_type;
}
template <typename Stat>
- typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type * bucket )
+ typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type * bkt )
{
- new (bucket) internal_bucket_type( m_Stat );
+ new (bkt) internal_bucket_type( m_Stat );
}
/// Calculates hash value of \p key
bool empty() const
{
typename gc::Guard guard;
- node_type * p = guard.protect( m_pHead, []( node_type * p ) -> value_type * { return node_traits::to_value_ptr( p );});
+ node_type * p = guard.protect( m_pHead, []( node_type * pNode ) -> value_type * { return node_traits::to_value_ptr( pNode );});
return p->m_pNext.load( memory_model::memory_order_relaxed ) == nullptr;
}
return m_Stat.onFind(
m_List.find_at( pHead, sv, cmp,
- [&f]( value_type& item, split_list::details::search_value_type<Q>& val ) { f( item, val.val ); } )
+ [&f]( value_type& item, split_list::details::search_value_type<Q>& v ) { f( item, v.val ); } )
);
}
aux_node_type * pHead = get_bucket( nHash );
assert( pHead != nullptr );
return m_Stat.onFind( m_List.find_at( pHead, sv, cmp,
- [&f](value_type& item, split_list::details::search_value_type<Q>& val){ f(item, val.val ); }));
+ [&f](value_type& item, split_list::details::search_value_type<Q>& v){ f(item, v.val ); }));
}
aux_node_type * alloc_aux_node( size_t nHash )
assert( pHead != nullptr );
return m_Stat.onFind( m_List.find_at( pHead, sv, cmp,
- [&f](value_type& item, split_list::details::search_value_type<Q>& val){ f(item, val.val ); }));
+ [&f](value_type& item, split_list::details::search_value_type<Q>& v){ f(item, v.val ); }));
}
template <typename Q, typename Compare>
};
public:
- explicit thread_pool( ::testing::Test& fixture )
- : m_fixture( fixture )
+ explicit thread_pool( ::testing::Test& fx )
+ : m_fixture( fx )
, m_bTimeElapsed( false )
{}
f = f * 5 + 0xe6546b64;
size_t iters = (len - 1) / 20;
do {
- uint32 a0 = Rotate32(Fetch32(s) * c1, 17) * c2;
- uint32 a1 = Fetch32(s + 4);
- uint32 a2 = Rotate32(Fetch32(s + 8) * c1, 17) * c2;
- uint32 a3 = Rotate32(Fetch32(s + 12) * c1, 17) * c2;
- uint32 a4 = Fetch32(s + 16);
+ a0 = Rotate32(Fetch32(s) * c1, 17) * c2;
+ a1 = Fetch32(s + 4);
+ a2 = Rotate32(Fetch32(s + 8) * c1, 17) * c2;
+ a3 = Rotate32(Fetch32(s + 12) * c1, 17) * c2;
+ a4 = Fetch32(s + 16);
h ^= a0;
h = Rotate32(h, 18);
h = h * 5 + 0xe6546b64;
EXPECT_FALSE( ret.second );
EXPECT_EQ( i.s.nUpdateExistsCall, 1 );
- ret = l.update( i, []( bool bNew, value_type& i, value_type& arg ) {
+ ret = l.update( i, []( bool bNew, value_type& vi, value_type& arg ) {
EXPECT_FALSE( bNew );
- EXPECT_EQ( i.s.nUpdateExistsCall, 1 );
- EXPECT_TRUE( &i == &arg );
- ++i.s.nUpdateExistsCall;
+ EXPECT_EQ( vi.s.nUpdateExistsCall, 1 );
+ EXPECT_TRUE( &vi == &arg );
+ ++vi.s.nUpdateExistsCall;
});
EXPECT_TRUE( ret.first );
EXPECT_FALSE( ret.second );
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::base_item_type base_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<base_item_type> cmp;
+ typedef typename TestFixture::template cmp<base_item_type> item_cmp;
typedef typename TestFixture::hash_int hash_int;
typedef ci::LazyList< rcu_type
, base_item_type
, typename ci::lazy_list::make_traits<
ci::opt::hook< ci::lazy_list::base_hook< ci::opt::gc< rcu_type > > >
- , ci::opt::compare< cmp >
+ , ci::opt::compare< item_cmp >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::base_item_type base_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template less<base_item_type> less;
+ typedef typename TestFixture::template less<base_item_type> item_less;
typedef typename TestFixture::hash_int hash_int;
typedef ci::LazyList< rcu_type
, base_item_type
, typename ci::lazy_list::make_traits<
ci::opt::hook< ci::lazy_list::base_hook< ci::opt::gc< rcu_type >>>
- , ci::opt::less< less >
+ , ci::opt::less< item_less >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<member_item_type> cmp;
+ typedef typename TestFixture::template cmp<member_item_type> item_cmp;
typedef typename TestFixture::hash_int hash_int;
typedef ci::LazyList< rcu_type
offsetof( member_item_type, hMember ),
ci::opt::gc<rcu_type>
>>
- , ci::opt::compare< cmp >
+ , ci::opt::compare< item_cmp >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template less<member_item_type> less;
+ typedef typename TestFixture::template less<member_item_type> item_less;
typedef typename TestFixture::hash_int hash_int;
typedef ci::LazyList< rcu_type
offsetof( member_item_type, hMember ),
ci::opt::gc<rcu_type>
> >
- , ci::opt::less< less >
+ , ci::opt::less< item_less >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::base_item_type base_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<base_item_type> cmp;
+ typedef typename TestFixture::template cmp<base_item_type> item_cmp;
typedef typename TestFixture::hash_int hash_int;
typedef ci::MichaelList< rcu_type
, base_item_type
, typename ci::michael_list::make_traits<
ci::opt::hook< ci::michael_list::base_hook< ci::opt::gc< rcu_type > > >
- , ci::opt::compare< cmp >
+ , ci::opt::compare< item_cmp >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::base_item_type base_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template less<base_item_type> less;
+ typedef typename TestFixture::template less<base_item_type> item_less;
typedef typename TestFixture::hash_int hash_int;
typedef ci::MichaelList< rcu_type
, base_item_type
, typename ci::michael_list::make_traits<
ci::opt::hook< ci::michael_list::base_hook< ci::opt::gc< rcu_type >>>
- , ci::opt::less< less >
+ , ci::opt::less< item_less >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<member_item_type> cmp;
+ typedef typename TestFixture::template cmp<member_item_type> item_cmp;
typedef typename TestFixture::hash_int hash_int;
typedef ci::MichaelList< rcu_type
offsetof( member_item_type, hMember ),
ci::opt::gc<rcu_type>
>>
- , ci::opt::compare< cmp >
+ , ci::opt::compare< item_cmp >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template less<member_item_type> less;
+ typedef typename TestFixture::template less<member_item_type> item_less;
typedef typename TestFixture::hash_int hash_int;
typedef ci::MichaelList< rcu_type
offsetof( member_item_type, hMember ),
ci::opt::gc<rcu_type>
> >
- , ci::opt::less< less >
+ , ci::opt::less< item_less >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::base_item_type base_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<base_item_type> cmp;
+ typedef typename TestFixture::template cmp<base_item_type> item_cmp;
struct traits : public ci::skip_list::traits
{
typedef ci::skip_list::base_hook< ci::opt::gc< rcu_type >> hook;
typedef mock_disposer disposer;
- typedef cmp compare;
+ typedef item_cmp compare;
};
typedef ci::SkipListSet< rcu_type, base_item_type, traits > set_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::base_item_type base_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<base_item_type> cmp;
+ typedef typename TestFixture::template cmp<base_item_type> item_cmp;
typedef typename TestFixture::template less<base_item_type> less_predicate;
struct traits : public ci::skip_list::traits
{
typedef ci::skip_list::base_hook< ci::opt::gc< rcu_type >> hook;
typedef mock_disposer disposer;
- typedef cmp compare;
+ typedef item_cmp compare;
typedef less_predicate less;
typedef ci::skip_list::stat<> stat;
};
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::base_item_type base_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<base_item_type> cmp;
+ typedef typename TestFixture::template cmp<base_item_type> item_cmp;
struct traits : public ci::skip_list::traits
{
typedef ci::skip_list::base_hook< ci::opt::gc< rcu_type >> hook;
typedef mock_disposer disposer;
- typedef cmp compare;
+ typedef item_cmp compare;
typedef ci::skip_list::xorshift32 random_level_generator;
};
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::base_item_type base_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<base_item_type> cmp;
+ typedef typename TestFixture::template cmp<base_item_type> item_cmp;
struct traits: public ci::skip_list::traits
{
typedef ci::skip_list::base_hook< ci::opt::gc< rcu_type >> hook;
typedef mock_disposer disposer;
- typedef cmp compare;
+ typedef item_cmp compare;
typedef ci::skip_list::xorshift24 random_level_generator;
};
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::base_item_type base_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<base_item_type> cmp;
+ typedef typename TestFixture::template cmp<base_item_type> item_cmp;
struct traits: public ci::skip_list::traits
{
typedef ci::skip_list::base_hook< ci::opt::gc< rcu_type >> hook;
typedef mock_disposer disposer;
- typedef cmp compare;
+ typedef item_cmp compare;
typedef ci::skip_list::xorshift16 random_level_generator;
};
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::base_item_type base_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<base_item_type> cmp;
+ typedef typename TestFixture::template cmp<base_item_type> item_cmp;
struct traits: public ci::skip_list::traits
{
typedef ci::skip_list::base_hook< ci::opt::gc< rcu_type >> hook;
typedef mock_disposer disposer;
- typedef cmp compare;
+ typedef item_cmp compare;
typedef ci::skip_list::turbo32 random_level_generator;
};
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::base_item_type base_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<base_item_type> cmp;
+ typedef typename TestFixture::template cmp<base_item_type> item_cmp;
struct traits: public ci::skip_list::traits
{
typedef ci::skip_list::base_hook< ci::opt::gc< rcu_type >> hook;
typedef mock_disposer disposer;
- typedef cmp compare;
+ typedef item_cmp compare;
typedef ci::skip_list::turbo16 random_level_generator;
};
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<member_item_type> cmp;
+ typedef typename TestFixture::template cmp<member_item_type> item_cmp;
struct traits : public ci::skip_list::traits
{
typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook;
typedef mock_disposer disposer;
- typedef cmp compare;
+ typedef item_cmp compare;
};
typedef ci::SkipListSet< rcu_type, member_item_type, traits > set_type;
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
typedef typename TestFixture::template less<member_item_type> less_predicate;
- typedef typename TestFixture::template cmp<member_item_type> cmp;
+ typedef typename TestFixture::template cmp<member_item_type> item_cmp;
struct traits : public ci::skip_list::traits
{
typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook;
typedef mock_disposer disposer;
- typedef cmp compare;
+ typedef item_cmp compare;
typedef less_predicate less;
typedef ci::skip_list::stat<> stat;
};
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
typedef typename TestFixture::template less<member_item_type> less_predicate;
- typedef typename TestFixture::template cmp<member_item_type> cmp;
+ typedef typename TestFixture::template cmp<member_item_type> item_cmp;
struct traits : public ci::skip_list::traits
{
typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook;
typedef mock_disposer disposer;
- typedef cmp compare;
+ typedef item_cmp compare;
typedef less_predicate less;
typedef ci::skip_list::stat<> stat;
typedef ci::skip_list::xorshift32 random_level_generator;
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
typedef typename TestFixture::template less<member_item_type> less_predicate;
- typedef typename TestFixture::template cmp<member_item_type> cmp;
+ typedef typename TestFixture::template cmp<member_item_type> item_cmp;
struct traits: public ci::skip_list::traits
{
typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook;
typedef mock_disposer disposer;
- typedef cmp compare;
+ typedef item_cmp compare;
typedef less_predicate less;
typedef ci::skip_list::stat<> stat;
typedef ci::skip_list::xorshift24 random_level_generator;
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
typedef typename TestFixture::template less<member_item_type> less_predicate;
- typedef typename TestFixture::template cmp<member_item_type> cmp;
+ typedef typename TestFixture::template cmp<member_item_type> item_cmp;
struct traits: public ci::skip_list::traits
{
typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook;
typedef mock_disposer disposer;
- typedef cmp compare;
+ typedef item_cmp compare;
typedef less_predicate less;
typedef ci::skip_list::stat<> stat;
typedef ci::skip_list::xorshift16 random_level_generator;
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
typedef typename TestFixture::template less<member_item_type> less_predicate;
- typedef typename TestFixture::template cmp<member_item_type> cmp;
+ typedef typename TestFixture::template cmp<member_item_type> item_cmp;
struct traits: public ci::skip_list::traits
{
typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook;
typedef mock_disposer disposer;
- typedef cmp compare;
+ typedef item_cmp compare;
typedef less_predicate less;
typedef ci::skip_list::stat<> stat;
typedef ci::skip_list::turbo32 random_level_generator;
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
typedef typename TestFixture::template less<member_item_type> less_predicate;
- typedef typename TestFixture::template cmp<member_item_type> cmp;
+ typedef typename TestFixture::template cmp<member_item_type> item_cmp;
struct traits: public ci::skip_list::traits
{
typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook;
typedef mock_disposer disposer;
- typedef cmp compare;
+ typedef item_cmp compare;
typedef less_predicate less;
typedef ci::skip_list::stat<> stat;
typedef ci::skip_list::turbo24 random_level_generator;
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
typedef typename TestFixture::template less<member_item_type> less_predicate;
- typedef typename TestFixture::template cmp<member_item_type> cmp;
+ typedef typename TestFixture::template cmp<member_item_type> item_cmp;
struct traits: public ci::skip_list::traits
{
typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook;
typedef mock_disposer disposer;
- typedef cmp compare;
+ typedef item_cmp compare;
typedef less_predicate less;
typedef ci::skip_list::stat<> stat;
typedef ci::skip_list::turbo16 random_level_generator;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::base_item_type base_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<base_item_type> cmp;
+ typedef typename TestFixture::template cmp<base_item_type> item_cmp;
typedef typename TestFixture::hash_int hash_int;
typedef ci::LazyList< rcu_type
, base_item_type
, typename ci::lazy_list::make_traits<
ci::opt::hook< ci::lazy_list::base_hook< ci::opt::gc< rcu_type > > >
- , ci::opt::compare< cmp >
+ , ci::opt::compare< item_cmp >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::base_item_type base_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template less<base_item_type> less;
+ typedef typename TestFixture::template less<base_item_type> item_less;
typedef typename TestFixture::hash_int hash_int;
typedef ci::LazyList< rcu_type
, base_item_type
, typename ci::lazy_list::make_traits<
ci::opt::hook< ci::lazy_list::base_hook< ci::opt::gc< rcu_type >>>
- , ci::opt::less< less >
+ , ci::opt::less< item_less >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<member_item_type> cmp;
+ typedef typename TestFixture::template cmp<member_item_type> item_cmp;
typedef typename TestFixture::hash_int hash_int;
typedef ci::LazyList< rcu_type
offsetof( member_item_type, hMember ),
ci::opt::gc<rcu_type>
>>
- , ci::opt::compare< cmp >
+ , ci::opt::compare< item_cmp >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template less<member_item_type> less;
+ typedef typename TestFixture::template less<member_item_type> item_less;
typedef typename TestFixture::hash_int hash_int;
typedef ci::LazyList< rcu_type
offsetof( member_item_type, hMember ),
ci::opt::gc<rcu_type>
> >
- , ci::opt::less< less >
+ , ci::opt::less< item_less >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::base_item_type base_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<base_item_type> cmp;
+ typedef typename TestFixture::template cmp<base_item_type> item_cmp;
typedef typename TestFixture::hash_int hash_int;
typedef ci::MichaelList< rcu_type
, base_item_type
, typename ci::michael_list::make_traits<
ci::opt::hook< ci::michael_list::base_hook< ci::opt::gc< rcu_type > > >
- , ci::opt::compare< cmp >
+ , ci::opt::compare< item_cmp >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::base_item_type base_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template less<base_item_type> less;
+ typedef typename TestFixture::template less<base_item_type> item_less;
typedef typename TestFixture::hash_int hash_int;
typedef ci::MichaelList< rcu_type
, base_item_type
, typename ci::michael_list::make_traits<
ci::opt::hook< ci::michael_list::base_hook< ci::opt::gc< rcu_type >>>
- , ci::opt::less< less >
+ , ci::opt::less< item_less >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template cmp<member_item_type> cmp;
+ typedef typename TestFixture::template cmp<member_item_type> item_cmp;
typedef typename TestFixture::hash_int hash_int;
typedef ci::MichaelList< rcu_type
offsetof( member_item_type, hMember ),
ci::opt::gc<rcu_type>
>>
- , ci::opt::compare< cmp >
+ , ci::opt::compare< item_cmp >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
typedef typename TestFixture::rcu_type rcu_type;
typedef typename TestFixture::member_item_type member_item_type;
typedef typename TestFixture::mock_disposer mock_disposer;
- typedef typename TestFixture::template less<member_item_type> less;
+ typedef typename TestFixture::template less<member_item_type> item_less;
typedef typename TestFixture::hash_int hash_int;
typedef ci::MichaelList< rcu_type
offsetof( member_item_type, hMember ),
ci::opt::gc<rcu_type>
> >
- , ci::opt::less< less >
+ , ci::opt::less< item_less >
, ci::opt::disposer< mock_disposer >
>::type
> bucket_type;
EXPECT_EQ( *a.load( oLoad ), 1 );
for ( integral_type i = 1; i < aSize; ++i ) {
- integral_type * p = a.load();
+ p = a.load();
EXPECT_EQ( *p, i );
EXPECT_EQ( a.fetch_add( 1, order ), p );
EXPECT_EQ( *a.load( oLoad ), i + 1 );
}
for ( integral_type i = aSize; i > 1; --i ) {
- integral_type * p = a.load();
+ p = a.load();
EXPECT_EQ( *p, i );
EXPECT_EQ( a.fetch_sub( 1, order ), p );
EXPECT_EQ( *a.load( oLoad ), i - 1 );
EXPECT_EQ( *a.load(), 1 );
for ( integral_type i = 1; i < aSize; ++i ) {
- integral_type * p = a.load();
+ p = a.load();
EXPECT_EQ( *p, i );
integral_type * pa = a.fetch_add( 1 );
EXPECT_EQ( pa, p );
}
for ( integral_type i = aSize; i > 1; --i ) {
- integral_type * p = a.load();
+ p = a.load();
EXPECT_EQ( *p, i );
EXPECT_EQ( a.fetch_sub( 1 ), p );
EXPECT_EQ( *a.load(), i - 1 );
EXPECT_EQ( *atomics::atomic_load_explicit( &a, oLoad ), 1 );
for ( integral_type i = 1; i < aSize; ++i ) {
- integral_type * p = atomics::atomic_load_explicit( &a, oLoad );
+ p = atomics::atomic_load_explicit( &a, oLoad );
EXPECT_EQ( *p, i );
EXPECT_EQ( atomics::atomic_fetch_add_explicit( &a, 1, order ), p );
EXPECT_EQ( *atomics::atomic_load_explicit( &a, oLoad ), i + 1 );
}
for ( integral_type i = aSize; i > 1; --i ) {
- integral_type * p = atomics::atomic_load_explicit( &a, oLoad );
+ p = atomics::atomic_load_explicit( &a, oLoad );
EXPECT_EQ( *p, i );
EXPECT_EQ( atomics::atomic_fetch_sub_explicit( &a, 1, order ), p );
EXPECT_EQ( *atomics::atomic_load_explicit( &a, oLoad ), i - 1 );
EXPECT_EQ( *atomics::atomic_load( &a ), 1 );
for ( integral_type i = 1; i < aSize; ++i ) {
- integral_type * p = atomics::atomic_load( &a );
+ p = atomics::atomic_load( &a );
EXPECT_EQ( *p, i );
EXPECT_EQ( atomics::atomic_fetch_add( &a, 1 ), p );
EXPECT_EQ( *atomics::atomic_load( &a ), i + 1 );
}
for ( integral_type i = aSize; i > 1; --i ) {
- integral_type * p = atomics::atomic_load( &a );
+ p = atomics::atomic_load( &a );
EXPECT_EQ( *p, i );
EXPECT_EQ( atomics::atomic_fetch_sub( &a, 1 ), p );
EXPECT_EQ( *atomics::atomic_load( &a ), i - 1 );
ASSERT_EQ( pq.size(), 0u );
// Clear test
- for ( value_type * p = pFirst; p < pLast; ++p ) {
+ for ( p = pFirst; p < pLast; ++p ) {
ASSERT_TRUE( pq.push( *p ));
}
EXPECT_FALSE( pq.empty());
EXPECT_EQ( pq.size(), 0u );
// clear_with test
- for ( value_type * p = pFirst; p < pLast; ++p ) {
+ for ( p = pFirst; p < pLast; ++p ) {
ASSERT_TRUE( pq.push( *p ));
}
ASSERT_FALSE( pq.empty());
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 );
});
}
case 0:
ASSERT_TRUE( m.insert( i ));
ASSERT_FALSE( m.insert( i ));
- ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& val ) {
- val.nVal = key.nKey;
- val.strVal = std::to_string( key.nKey );
+ ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& v ) {
+ v.nVal = key.nKey;
+ v.strVal = std::to_string( key.nKey );
} ));
break;
case 1:
ASSERT_TRUE( m.insert( i.nKey ));
ASSERT_FALSE( m.insert( i.nKey ));
- ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& val ) {
- val.nVal = key.nKey;
- val.strVal = std::to_string( key.nKey );
+ ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& v ) {
+ v.nVal = key.nKey;
+ v.strVal = std::to_string( key.nKey );
} ));
break;
case 2:
ASSERT_TRUE( m.insert( std::to_string( i.nKey )));
ASSERT_FALSE( m.insert( std::to_string( i.nKey )));
- ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& val ) {
- val.nVal = key.nKey;
- val.strVal = std::to_string( key.nKey );
+ ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& v ) {
+ v.nVal = key.nKey;
+ v.strVal = std::to_string( key.nKey );
} ));
break;
case 3:
ASSERT_FALSE( m.insert( val.strVal, i.nKey ));
break;
case 6:
- ASSERT_TRUE( m.insert_with( i, []( key_type const& key, value_type& val ) {
- val.nVal = key.nKey;
- val.strVal = std::to_string( key.nKey );
+ ASSERT_TRUE( m.insert_with( i, []( key_type const& key, value_type& v ) {
+ v.nVal = key.nKey;
+ v.strVal = std::to_string( key.nKey );
} ));
ASSERT_FALSE( m.insert_with( i, []( key_type const& /*key*/, value_type& /*val*/ ) {
EXPECT_TRUE( false );
} ));
break;
case 7:
- ASSERT_TRUE( m.insert_with( i.nKey, []( key_type const& key, value_type& val ) {
- val.nVal = key.nKey;
- val.strVal = std::to_string( key.nKey );
+ ASSERT_TRUE( m.insert_with( i.nKey, []( key_type const& key, value_type& v ) {
+ v.nVal = key.nKey;
+ v.strVal = std::to_string( key.nKey );
} ));
ASSERT_FALSE( m.insert_with( i.nKey, []( key_type const& /*key*/, value_type& /*val*/ ) {
EXPECT_TRUE( false );
} ));
break;
case 8:
- ASSERT_TRUE( m.insert_with( val.strVal, []( key_type const& key, value_type& val ) {
- val.nVal = key.nKey;
- val.strVal = std::to_string( key.nKey );
+ ASSERT_TRUE( m.insert_with( val.strVal, []( key_type const& key, value_type& v ) {
+ v.nVal = key.nKey;
+ v.strVal = std::to_string( key.nKey );
} ));
ASSERT_FALSE( m.insert_with( val.strVal, []( key_type const& /*key*/, value_type& /*val*/ ) {
EXPECT_TRUE( false );
ASSERT_FALSE( updResult.first );
ASSERT_FALSE( updResult.second );
- updResult = m.update( i.nKey, []( bool bNew, key_type const& key, value_type& val ) {
+ updResult = m.update( i.nKey, []( bool bNew, key_type const& key, value_type& v ) {
EXPECT_TRUE( bNew );
- val.nVal = key.nKey;
+ v.nVal = key.nKey;
});
ASSERT_TRUE( updResult.first );
ASSERT_TRUE( updResult.second );
- updResult = m.update( i.nKey, []( bool bNew, key_type const& key, value_type& val ) {
+ updResult = m.update( i.nKey, []( bool bNew, key_type const& key, value_type& v ) {
EXPECT_FALSE( bNew );
- EXPECT_EQ( key.nKey, val.nVal );
- val.strVal = std::to_string( val.nVal );
+ EXPECT_EQ( key.nKey, v.nVal );
+ v.strVal = std::to_string( v.nVal );
} );
ASSERT_TRUE( updResult.first );
ASSERT_FALSE( updResult.second );
ASSERT_FALSE( updResult.first );
ASSERT_FALSE( updResult.second );
- updResult = m.update( i, []( bool bNew, key_type const& key, value_type& val ) {
+ updResult = m.update( i, []( bool bNew, key_type const& key, value_type& v ) {
EXPECT_TRUE( bNew );
- val.nVal = key.nKey;
+ v.nVal = key.nKey;
});
ASSERT_TRUE( updResult.first );
ASSERT_TRUE( updResult.second );
- updResult = m.update( i, []( bool bNew, key_type const& key, value_type& val ) {
+ updResult = m.update( i, []( bool bNew, key_type const& key, value_type& v ) {
EXPECT_FALSE( bNew );
- EXPECT_EQ( key.nKey, val.nVal );
- val.strVal = std::to_string( val.nVal );
+ EXPECT_EQ( key.nKey, v.nVal );
+ v.strVal = std::to_string( v.nVal );
} );
ASSERT_TRUE( updResult.first );
ASSERT_FALSE( updResult.second );
ASSERT_FALSE( updResult.first );
ASSERT_FALSE( updResult.second );
- updResult = m.update( val.strVal, []( bool bNew, key_type const& key, value_type& val ) {
+ updResult = m.update( val.strVal, []( bool bNew, key_type const& key, value_type& v ) {
EXPECT_TRUE( bNew );
- val.nVal = key.nKey;
+ v.nVal = key.nKey;
});
ASSERT_TRUE( updResult.first );
ASSERT_TRUE( updResult.second );
- updResult = m.update( val.strVal, []( bool bNew, key_type const& key, value_type& val ) {
+ updResult = m.update( val.strVal, []( bool bNew, key_type const& key, value_type& v ) {
EXPECT_FALSE( bNew );
- EXPECT_EQ( key.nKey, val.nVal );
- val.strVal = std::to_string( val.nVal );
+ EXPECT_EQ( key.nKey, v.nVal );
+ v.strVal = std::to_string( v.nVal );
} );
ASSERT_TRUE( updResult.first );
ASSERT_FALSE( updResult.second );
case 12:
ASSERT_TRUE( m.emplace( i.nKey ));
ASSERT_FALSE( m.emplace( i.nKey ));
- ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& val ) {
- val.nVal = key.nKey;
- val.strVal = std::to_string( key.nKey );
+ ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& v ) {
+ v.nVal = key.nKey;
+ v.strVal = std::to_string( key.nKey );
} ));
break;
case 13:
ASSERT_TRUE( m.contains( i.nKey ));
ASSERT_TRUE( m.contains( i ));
ASSERT_TRUE( m.contains( other_item( i.nKey ), other_less()));
- ASSERT_TRUE( m.find( i, []( key_type const& key, value_type& val ) {
- EXPECT_EQ( key.nKey, val.nVal );
- EXPECT_EQ( std::to_string( key.nKey ), val.strVal );
+ ASSERT_TRUE( m.find( i, []( key_type const& key, value_type& v ) {
+ EXPECT_EQ( key.nKey, v.nVal );
+ EXPECT_EQ( std::to_string( key.nKey ), v.strVal );
} ));
- ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& val ) {
- EXPECT_EQ( key.nKey, val.nVal );
- EXPECT_EQ( std::to_string( key.nKey ), val.strVal );
+ ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& v ) {
+ EXPECT_EQ( key.nKey, v.nVal );
+ EXPECT_EQ( std::to_string( key.nKey ), v.strVal );
} ));
- ASSERT_TRUE( m.find_with( other_item( i.nKey ), other_less(), []( key_type const& key, value_type& val ) {
- EXPECT_EQ( key.nKey, val.nVal );
- EXPECT_EQ( std::to_string( key.nKey ), val.strVal );
+ ASSERT_TRUE( m.find_with( other_item( i.nKey ), other_less(), []( key_type const& key, value_type& v ) {
+ EXPECT_EQ( key.nKey, v.nVal );
+ EXPECT_EQ( std::to_string( key.nKey ), v.strVal );
} ));
}
ASSERT_FALSE( m.empty());
ASSERT_TRUE( m.contains( val.strVal ));
ASSERT_TRUE( m.contains( i ));
ASSERT_TRUE( m.contains( other_item( i.nKey ), other_less()));
- ASSERT_TRUE( m.find( i, []( key_type const& key, value_type& val ) {
- EXPECT_EQ( key.nKey, val.nVal );
- EXPECT_EQ( std::to_string( key.nKey ), val.strVal );
+ ASSERT_TRUE( m.find( i, []( key_type const& key, value_type& v ) {
+ EXPECT_EQ( key.nKey, v.nVal );
+ EXPECT_EQ( std::to_string( key.nKey ), v.strVal );
} ));
- ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& val ) {
- EXPECT_EQ( key.nKey, val.nVal );
- EXPECT_EQ( std::to_string( key.nKey ), val.strVal );
+ ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& v ) {
+ EXPECT_EQ( key.nKey, v.nVal );
+ EXPECT_EQ( std::to_string( key.nKey ), v.strVal );
} ));
- ASSERT_TRUE( m.find_with( other_item( i.nKey ), other_less(), []( key_type const& key, value_type& val ) {
- EXPECT_EQ( key.nKey, val.nVal );
- EXPECT_EQ( std::to_string( key.nKey ), val.strVal );
+ ASSERT_TRUE( m.find_with( other_item( i.nKey ), other_less(), []( key_type const& key, value_type& v ) {
+ EXPECT_EQ( key.nKey, v.nVal );
+ EXPECT_EQ( std::to_string( key.nKey ), v.strVal );
} ));
ASSERT_FALSE( m.erase_with( other_item( i.nKey ), other_less()));
break;
case 4:
- ASSERT_TRUE( m.erase( i, []( key_type const& key, value_type& val ) {
- EXPECT_EQ( key.nKey, val.nVal );
- EXPECT_EQ( std::to_string( key.nKey ), val.strVal );
+ ASSERT_TRUE( m.erase( i, []( key_type const& key, value_type& v ) {
+ EXPECT_EQ( key.nKey, v.nVal );
+ EXPECT_EQ( std::to_string( key.nKey ), v.strVal );
}));
ASSERT_FALSE( m.erase( i, []( key_type const& /*key*/, value_type& /*val*/ ) {
EXPECT_TRUE( false );
}));
break;
case 5:
- ASSERT_TRUE( m.erase( i.nKey, []( key_type const& key, value_type& val ) {
- EXPECT_EQ( key.nKey, val.nVal );
- EXPECT_EQ( std::to_string( key.nKey ), val.strVal );
+ ASSERT_TRUE( m.erase( i.nKey, []( key_type const& key, value_type& v ) {
+ EXPECT_EQ( key.nKey, v.nVal );
+ EXPECT_EQ( std::to_string( key.nKey ), v.strVal );
}));
ASSERT_FALSE( m.erase( i.nKey, []( key_type const& /*key*/, value_type& /*val*/ ) {
EXPECT_TRUE( false );
}));
break;
case 6:
- ASSERT_TRUE( m.erase( val.strVal, []( key_type const& key, value_type& val ) {
- EXPECT_EQ( key.nKey, val.nVal );
- EXPECT_EQ( std::to_string( key.nKey ), val.strVal );
+ ASSERT_TRUE( m.erase( val.strVal, []( key_type const& key, value_type& v ) {
+ EXPECT_EQ( key.nKey, v.nVal );
+ EXPECT_EQ( std::to_string( key.nKey ), v.strVal );
}));
ASSERT_FALSE( m.erase( val.strVal, []( key_type const& /*key*/, value_type& /*val*/ ) {
EXPECT_TRUE( false );
}));
break;
case 7:
- ASSERT_TRUE( m.erase_with( other_item( i.nKey ), other_less(), []( key_type const& key, value_type& val ) {
- EXPECT_EQ( key.nKey, val.nVal );
- EXPECT_EQ( std::to_string( key.nKey ), val.strVal );
+ ASSERT_TRUE( m.erase_with( other_item( i.nKey ), other_less(), []( key_type const& key, value_type& v ) {
+ EXPECT_EQ( key.nKey, v.nVal );
+ EXPECT_EQ( std::to_string( key.nKey ), v.strVal );
}));
ASSERT_FALSE( m.erase_with( other_item( i.nKey ), other_less(), []( key_type const& /*key*/, value_type& /*val*/ ) {
EXPECT_TRUE( false );