Now you are ready to declare our set class based on \p %SplitListSet:
\code
- typedef cc::SplitListSet< cds::gc::PTB, foo, foo_set_traits > foo_set;
+ typedef cc::SplitListSet< cds::gc::DHP, foo, foo_set_traits > foo_set;
\endcode
You may use the modern option-based declaration instead of classic traits-based one:
\code
typedef cc:SplitListSet<
- cs::gc::PTB // GC used
+ cs::gc::DHP // GC used
,foo // type of data stored
,cc::split_list::make_traits< // metafunction to build split-list traits
cc::split_list::ordered_list<cc::lazy_list_tag> // tag for underlying ordered list implementation
template <typename Q, typename Less, typename Func>
bool find_with_( Q& val, Less pred, Func f )
{
+ 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) ; } );
}
template <typename Q, typename Less>
bool erase_with( Q const& key, Less pred )
{
+ CDS_UNUSED( pred );
return base_class::erase_with( key, typename maker::template predicate_wrapper<Less>::type() );
}
template <typename Q, typename Less, typename Func>
bool erase_with( Q const& key, Less pred, Func f )
{
+ CDS_UNUSED( pred );
return base_class::erase_with( key, typename maker::template predicate_wrapper<Less>::type(),
[&f](node_type& node) { f( node.m_Value ); } );
}
\endcode
where \p item is the item found, \p key is the <tt>find</tt> function argument.
- You may pass \p f argument by reference using \p std::ref.
-
The functor may change non-key fields of \p item. Note that the functor is only guarantee
that \p item cannot be disposed during functor is executing.
The functor does not serialize simultaneous access to the set's \p item. If such access is
{
return find_( key, f );
}
+ //@cond
+ template <typename Q, typename Func>
+ bool find( Q const& key, Func f )
+ {
+ return find_( key, f );
+ }
+ //@endcond
/// Finds the key \p key using \p pred predicate for searching
/**
{
return find_with_( key, pred, f );
}
+ //@cond
+ template <typename Q, typename Less, typename Func>
+ bool find_with( Q const& key, Less pred, Func f )
+ {
+ return find_with_( key, pred, f );
+ }
+ //@endcond
/// Finds the key \p key
/** \anchor cds_nonintrusive_SplitListSet_find_val
template <typename Q, typename Less>
bool find_with( Q const& key, Less pred )
{
+ CDS_UNUSED( pred );
return base_class::find_with( key, typename maker::template predicate_wrapper<Less>::type() );
}
template <typename Q, typename Less>
bool extract_with_( typename gc::Guard& guard, Q const& key, Less pred )
{
+ CDS_UNUSED( pred );
return base_class::extract_with_( guard, key, typename maker::template predicate_wrapper<Less>::type() );
}
template <typename Q, typename Less>
bool get_with_( typename gc::Guard& guard, Q const& key, Less pred )
{
+ CDS_UNUSED( pred );
return base_class::get_with_( guard, key, typename maker::template predicate_wrapper<Less>::type() );
}