node_type * pCur;
};
-# ifndef CDS_CXX11_LAMBDA_SUPPORT
- struct empty_insert_functor {
- void operator()( value_type& )
- {}
- };
-
- struct empty_find_functor {
- template <typename Q>
- void operator()( value_type& item, Q& val )
- {}
- };
-
- template <typename Func>
- struct insert_at_ensure_functor {
- Func m_func;
- insert_at_ensure_functor( Func f ) : m_func(f) {}
-
- void operator()( value_type& item )
- {
- cds::unref( m_func)( true, item, item );
- }
- };
-
-# endif // ifndef CDS_CXX11_LAMBDA_SUPPORT
-
class head_node: public node_type
{
typename node_type::atomic_ptr m_Tower[c_nMaxHeight];
bTowerOk = true;
}
-# ifndef CDS_CXX11_LAMBDA_SUPPORT
- if ( !insert_at_position( val, pNode, pos, empty_insert_functor() ))
-# else
- if ( !insert_at_position( val, pNode, pos, []( value_type& ) {} ))
-# endif
- {
+ if ( !insert_at_position( val, pNode, pos, []( value_type& ) {} )) {
m_Stat.onInsertRetry();
continue;
}
bool bTowerOk = nHeight > 1 && pNode->get_tower() != nullptr;
bool bTowerMade = false;
-# ifndef CDS_CXX11_LAMBDA_SUPPORT
- insert_at_ensure_functor<Func> wrapper( func );
-# endif
-
position pos;
while ( true )
{
bTowerOk = true;
}
-# ifdef CDS_CXX11_LAMBDA_SUPPORT
- if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { cds::unref(func)( true, item, item ); }))
-# else
- if ( !insert_at_position( val, pNode, pos, cds::ref(wrapper) ))
-# endif
- {
+ if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { cds::unref(func)( true, item, item ); })) {
m_Stat.onInsertRetry();
continue;
}
template <typename Q>
value_type * find( Q const& val ) const
{
- node_type * pNode =
-# ifdef CDS_CXX11_LAMBDA_SUPPORT
- find_with_( val, key_comparator(), [](value_type& , Q const& ) {} );
-# else
- find_with_( val, key_comparator(), empty_find_functor() );
-# endif
+ node_type * pNode = find_with_( val, key_comparator(), [](value_type& , Q const& ) {} );
if ( pNode )
return node_traits::to_value_ptr( pNode );
return nullptr;
template <typename Q, typename Less>
value_type * find_with( Q const& val, Less pred ) const
{
- node_type * pNode =
-# ifdef CDS_CXX11_LAMBDA_SUPPORT
- find_with_( val, cds::opt::details::make_comparator_from_less<Less>(), [](value_type& , Q const& ) {} );
-# else
- find_with_( val, cds::opt::details::make_comparator_from_less<Less>(), empty_find_functor() );
-# endif
+ node_type * pNode = find_with_( val, cds::opt::details::make_comparator_from_less<Less>(), [](value_type& , Q const& ) {} );
if ( pNode )
return node_traits::to_value_ptr( pNode );
return nullptr;