*/
template <
class GC
- ,typename Lock = lock::Spin
+ ,typename Lock = cds::lock::Spin
,typename Tag = opt::none
>
struct node
- \p GC - Garbage collector used. Note the \p GC must be the same as the GC used for item type \p T (see lazy_list::node).
- \p T - type to be stored in the list. The type must be based on lazy_list::node (for lazy_list::base_hook)
or it must have a member of type lazy_list::node (for lazy_list::member_hook).
- - \p Traits - type traits. See lazy_list::type_traits for explanation.
-
- It is possible to declare option-based list with cds::intrusive::lazy_list::make_traits metafunction istead of \p Traits template
- argument. For example, the following traits-based declaration of gc::HP lazy list
- \code
- #include <cds/intrusive/lazy_list_hp.h>
- // Declare item stored in your list
- struct item: public cds::intrusive::lazy_list::node< cds::gc::HP >
- { ... };
-
- // Declare comparator for the item
- struct my_compare { ... }
-
- // Declare type_traits
- struct my_traits: public cds::intrusive::lazy_list::type_traits
- {
- typedef cds::intrusive::lazy_list::base_hook< cds::opt::gc< cds::gc::HP > > hook;
- typedef my_compare compare;
- };
+ - \p Traits - type traits. See lazy_list::traits for explanation.
+ It is possible to declare option-based list with cds::intrusive::lazy_list::make_traits metafunction istead of \p Traits template
+ argument. For example, the following traits-based declaration of \p gc::HP lazy list
+ \code
+ #include <cds/intrusive/lazy_list_hp.h>
+ // Declare item stored in your list
+ struct item: public cds::intrusive::lazy_list::node< cds::gc::HP >
+ { ... };
- // Declare traits-based list
- typedef cds::intrusive::LazyList< cds::gc::HP, item, my_traits > traits_based_list;
- \endcode
+ // Declare comparator for the item
+ struct my_compare { ... }
- is equivalent for the following option-based list
- \code
- #include <cds/intrusive/lazy_list_hp.h>
+ // Declare traits
+ struct my_traits: public cds::intrusive::lazy_list::traits
+ {
+ typedef cds::intrusive::lazy_list::base_hook< cds::opt::gc< cds::gc::HP > > hook;
+ typedef my_compare compare;
+ };
- // item struct and my_compare are the same
+ // Declare traits-based list
+ typedef cds::intrusive::LazyList< cds::gc::HP, item, my_traits > traits_based_list;
+ \endcode
+ is equivalent for the following option-based list
+ \code
+ #include <cds/intrusive/lazy_list_hp.h>
- // Declare option-based list
- typedef cds::intrusive::LazyList< cds::gc::HP, item,
- typename cds::intrusive::lazy_list::make_traits<
- cds::intrusive::opt::hook< cds::intrusive::lazy_list::base_hook< cds::opt::gc< cds::gc::HP > > > // hook option
- ,cds::intrusive::opt::compare< my_compare > // item comparator option
- >::type
- > option_based_list;
- \endcode
+ // item struct and my_compare are the same
- Template argument list \p Options of cds::intrusive::lazy_list::make_traits metafunction are:
- - opt::hook - hook used. Possible values are: lazy_list::base_hook, lazy_list::member_hook, lazy_list::traits_hook.
- If the option is not specified, <tt>lazy_list::base_hook<></tt> and gc::HP is used.
- - opt::compare - key comparison functor. No default functor is provided.
- If the option is not specified, the opt::less is used.
- - opt::less - specifies binary predicate used for key comparison. Default is \p std::less<T>.
- - opt::back_off - back-off strategy used. If the option is not specified, the cds::backoff::Default is used.
- - opt::disposer - the functor used for dispose removed items. Default is opt::v::empty_disposer. Due the nature
- of GC schema the disposer may be called asynchronously.
- - opt::link_checker - the type of node's link fields checking. Default is \ref opt::debug_check_link
- - opt::item_counter - the type of item counting feature. Default is \ref atomicity::empty_item_counter that means no item counting.
- - opt::allocator - an allocator needed for dummy head and tail nodes. Default is \ref CDS_DEFAULT_ALLOCATOR.
- The option applies only to gc::HRC garbage collector.
- - opt::memory_model - C++ memory ordering model. Can be opt::v::relaxed_ordering (relaxed memory model, the default)
- or opt::v::sequential_consistent (sequentially consisnent memory model).
+ // Declare option-based list
+ typedef cds::intrusive::LazyList< cds::gc::HP, item,
+ typename cds::intrusive::lazy_list::make_traits<
+ cds::intrusive::opt::hook< cds::intrusive::lazy_list::base_hook< cds::opt::gc< cds::gc::HP > > > // hook option
+ ,cds::intrusive::opt::compare< my_compare > // item comparator option
+ >::type
+ > option_based_list;
+ \endcode
\par Usage
There are different specializations of this template for each garbage collecting schema used.
- for \ref cds_urcu_type "RCU" - see \ref cds_intrusive_LazyList_rcu "LazyList RCU specialization"
Then, you should incorporate lazy_list::node into your struct \p T and provide
- appropriate lazy_list::type_traits::hook in your \p Traits template parameters. Usually, for \p Traits
- a struct based on lazy_list::type_traits should be defined.
+ appropriate \p lazy_list::traits::hook in your \p Traits template parameters. Usually, for \p Traits
+ a struct based on \p lazy_list::traits should be defined.
- Example for gc::PTB and base hook:
+ Example for gc::DHP and base hook:
\code
// Include GC-related lazy list specialization
#include <cds/intrusive/lazy_list_dhp.h>
// Data stored in lazy list
- struct my_data: public cds::intrusive::lazy_list::node< cds::gc::PTB >
+ struct my_data: public cds::intrusive::lazy_list::node< cds::gc::DHP >
{
// key field
std::string strKey;
}
};
-
- // Declare type_traits
- struct my_traits: public cds::intrusive::lazy_list::type_traits
+ // Declare traits
+ struct my_traits: public cds::intrusive::lazy_list::traits
{
- typedef cds::intrusive::lazy_list::base_hook< cds::opt::gc< cds::gc::PTB > > hook;
+ typedef cds::intrusive::lazy_list::base_hook< cds::opt::gc< cds::gc::DHP > > hook;
typedef my_data_cmp compare;
};
// Declare list type
- typedef cds::intrusive::LazyList< cds::gc::PTB, my_data, my_traits > traits_based_list;
+ typedef cds::intrusive::LazyList< cds::gc::DHP, my_data, my_traits > traits_based_list;
\endcode
Equivalent option-based code:
};
// Declare option-based list
- typedef cds::intrusive::LazyList< cds::gc::PTB
+ typedef cds::intrusive::LazyList< cds::gc::DHP
,my_data
, typename cds::intrusive::lazy_list::make_traits<
- cds::intrusive::opt::hook< cds::intrusive::lazy_list::base_hook< cds::opt::gc< cds::gc::PTB > > >
+ cds::intrusive::opt::hook< cds::intrusive::lazy_list::base_hook< cds::opt::gc< cds::gc::DHP > > >
,cds::intrusive::opt::compare< my_data_cmp >
>::type
> option_based_list;
class GC
,typename T
#ifdef CDS_DOXYGEN_INVOKED
- ,class Traits = lazy_list::type_traits
+ ,class Traits = lazy_list::traits
#else
,class Traits
#endif
class LazyList
{
public:
- typedef T value_type ; ///< type of value stored in the list
- typedef Traits options ; ///< Traits template parameter
+ typedef GC gc; ///< Garbage collector
+ typedef T value_type; ///< type of value stored in the list
+ typedef Traits traits; ///< Traits template parameter
- typedef typename options::hook hook ; ///< hook type
- typedef typename hook::node_type node_type ; ///< node type
+ typedef typename traits::hook hook; ///< hook type
+ typedef typename hook::node_type node_type; ///< node type
# ifdef CDS_DOXYGEN_INVOKED
typedef implementation_defined key_comparator ; ///< key comparison functor based on opt::compare and opt::less option setter.
# else
- typedef typename opt::details::make_comparator< value_type, options >::type key_comparator;
+ typedef typename opt::details::make_comparator< value_type, traits >::type key_comparator;
# endif
- typedef typename options::disposer disposer ; ///< disposer used
- typedef typename get_node_traits< value_type, node_type, hook>::type node_traits ; ///< node traits
- typedef typename lazy_list::get_link_checker< node_type, options::link_checker >::type link_checker ; ///< link checker
+ typedef typename traits::disposer disposer; ///< disposer
+ typedef typename get_node_traits< value_type, node_type, hook>::type node_traits; ///< node traits
+ typedef typename lazy_list::get_link_checker< node_type, traits::link_checker >::type link_checker; ///< link checker
- typedef GC gc ; ///< Garbage collector
- typedef typename options::back_off back_off ; ///< back-off strategy
- typedef typename options::item_counter item_counter ; ///< Item counting policy used
- typedef typename options::memory_model memory_model; ///< C++ memory ordering (see lazy_list::type_traits::memory_model)
+ typedef typename traits::back_off back_off ; ///< back-off strategy
+ typedef typename traits::item_counter item_counter ; ///< Item counting policy used
+ typedef typename traits::memory_model memory_model; ///< C++ memory ordering (see \p lazy_list::traits::memory_model)
typedef cds::gc::guarded_ptr< gc, value_type > guarded_ptr; ///< Guarded pointer
//@cond
- // Rebind options (split-list support)
+ // Rebind traits (split-list support)
template <typename... Options>
struct rebind_options {
typedef LazyList<
gc
, value_type
- , typename cds::opt::make_options< options, Options...>::type
+ , typename cds::opt::make_options< traits, Options...>::type
> type;
};
//@endcond
protected:
- typedef typename node_type::marked_ptr marked_node_ptr ; ///< Node marked pointer
- typedef node_type * auxiliary_head ; ///< Auxiliary head type (for split-list support)
+ typedef typename node_type::marked_ptr marked_node_ptr; ///< Node marked pointer
+ typedef node_type * auxiliary_head; ///< Auxiliary head type (for split-list support)
protected:
//@cond
where \p val is the item inserted.
While the functor \p f is working the item \p val is locked.
The user-defined functor is called only if the inserting is success.
-
- @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
*/
template <typename Func>
bool insert( value_type& val, Func f )
Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
\p second is \p true if new item has been added or \p false if the item with \p key
already is in the list.
-
- @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
*/
template <typename Func>
std::pair<bool, bool> ensure( value_type& val, Func func )
/// Deletes the item from the list
/** \anchor cds_intrusive_LazyList_hp_erase_val
- The function searches an item with key equal to \p val in the list,
+ The function searches an item with key equal to \p key in the list,
unlinks it from the list, and returns \p true.
- If the item with the key equal to \p val is not found the function return \p false.
+ If the item with the key equal to \p key is not found the function return \p false.
*/
template <typename Q>
- bool erase( Q const& val )
+ bool erase( Q const& key )
{
- return erase_at( &m_Head, val, key_comparator() );
+ return erase_at( &m_Head, key, key_comparator() );
}
/// Deletes the item from the list using \p pred predicate for searching
\p pred must imply the same element order as the comparator used for building the list.
*/
template <typename Q, typename Less>
- bool erase_with( Q const& val, Less pred )
+ bool erase_with( Q const& key, Less pred )
{
- return erase_at( &m_Head, val, cds::opt::details::make_comparator_from_less<Less>() );
+ return erase_at( &m_Head, key, cds::opt::details::make_comparator_from_less<Less>() );
}
/// Deletes the item from the list
/** \anchor cds_intrusive_LazyList_hp_erase_func
- The function searches an item with key equal to \p val in the list,
+ The function searches an item with key equal to \p key in the list,
call \p func functor with item found, unlinks it from the list, and returns \p true.
The \p Func interface is
\code
void operator()( value_type const& item );
};
\endcode
- The functor may be passed by reference using <tt>boost:ref</tt>
- If the item with the key equal to \p val is not found the function return \p false.
+ If \p key is not found the function return \p false.
*/
template <typename Q, typename Func>
- bool erase( const Q& val, Func func )
+ bool erase( const Q& key, Func func )
{
- return erase_at( &m_Head, val, key_comparator(), func );
+ return erase_at( &m_Head, key, key_comparator(), func );
}
/// Deletes the item from the list using \p pred predicate for searching
\p pred must imply the same element order as the comparator used for building the list.
*/
template <typename Q, typename Less, typename Func>
- bool erase_with( const Q& val, Less pred, Func func )
+ bool erase_with( const Q& key, Less pred, Func func )
{
- return erase_at( &m_Head, val, cds::opt::details::make_comparator_from_less<Less>(), func );
+ return erase_at( &m_Head, key, cds::opt::details::make_comparator_from_less<Less>(), func );
}
/// Extracts the item from the list with specified \p key
return extract_at( &m_Head, dest.guard(), key, cds::opt::details::make_comparator_from_less<Less>() );
}
- /// Finds the key \p val
+ /// Finds the key \p key
/** \anchor cds_intrusive_LazyList_hp_find
- The function searches the item with key equal to \p val and calls the functor \p f for item found.
+ The function searches the item with key equal to \p key and calls the functor \p f for item found.
The interface of \p Func functor is:
\code
struct functor {
- void operator()( value_type& item, Q& val );
+ void operator()( value_type& item, Q& key );
};
\endcode
- where \p item is the item found, \p val is the <tt>find</tt> function argument.
-
- You may pass \p f argument by reference using \p std::ref.
+ where \p item is the item found, \p key is the <tt>find</tt> function argument.
The functor may change non-key fields of \p item.
While the functor \p f is calling the item \p item is locked.
- The \p val argument is non-const since it can be used as \p f functor destination i.e., the functor
- may modify both arguments.
-
- The function returns \p true if \p val is found, \p false otherwise.
+ The function returns \p true if \p key is found, \p false otherwise.
*/
template <typename Q, typename Func>
- bool find( Q& val, Func f )
+ bool find( Q& key, Func f )
{
- return find_at( &m_Head, val, key_comparator(), f );
+ return find_at( &m_Head, key, key_comparator(), f );
}
- /// Finds the key \p val using \p pred predicate for searching
+ /// Finds the key \p key using \p pred predicate for searching
/**
The function is an analog of \ref cds_intrusive_LazyList_hp_find "find(Q&, Func)"
but \p pred is used for key comparing.
\p pred must imply the same element order as the comparator used for building the list.
*/
template <typename Q, typename Less, typename Func>
- bool find_with( Q& val, Less pred, Func f )
- {
- return find_at( &m_Head, val, cds::opt::details::make_comparator_from_less<Less>(), f );
- }
-
- /// Finds the key \p val
- /** \anchor cds_intrusive_LazyList_hp_find_const
- The function searches the item with key equal to \p val and calls the functor \p f for item found.
- The interface of \p Func functor is:
- \code
- struct functor {
- void operator()( value_type& item, Q const& val );
- };
- \endcode
- where \p item is the item found, \p val is the \p find function argument.
-
- You may pass \p f argument by reference using \p std::ref.
-
- The functor may change non-key fields of \p item.
- While the functor \p f is calling the item \p item is locked.
-
- The function returns \p true if \p val is found, \p false otherwise.
- */
- template <typename Q, typename Func>
- bool find( Q const& val, Func f )
- {
- return find_at( &m_Head, val, key_comparator(), f );
- }
-
- /// Finds the key \p val using \p pred predicate for searching
- /**
- The function is an analog of \ref cds_intrusive_LazyList_hp_find_const "find(Q const&, Func)"
- but \p pred is used for key comparing.
- \p Less functor has the interface like \p std::less.
- \p pred must imply the same element order as the comparator used for building the list.
- */
- template <typename Q, typename Less, typename Func>
- bool find_with( Q const& val, Less pred, Func f )
+ bool find_with( Q& key, Less pred, Func f )
{
- return find_at( &m_Head, val, cds::opt::details::make_comparator_from_less<Less>(), f );
+ return find_at( &m_Head, key, cds::opt::details::make_comparator_from_less<Less>(), f );
}
- /// Finds the key \p val
+ /// Finds the key \p key
/** \anchor cds_intrusive_LazyList_hp_find_val
- The function searches the item with key equal to \p val
+ The function searches the item with key equal to \p key
and returns \p true if it is found, and \p false otherwise
*/
template <typename Q>
- bool find( Q const & val )
+ bool find( Q const & key )
{
- return find_at( &m_Head, val, key_comparator() );
+ return find_at( &m_Head, key, key_comparator() );
}
- /// Finds the key \p val using \p pred predicate for searching
+ /// Finds \p key using \p pred predicate for searching
/**
The function is an analog of \ref cds_intrusive_LazyList_hp_find_val "find(Q const&)"
but \p pred is used for key comparing.
\p pred must imply the same element order as the comparator used for building the list.
*/
template <typename Q, typename Less>
- bool find_with( Q const& val, Less pred )
+ bool find_with( Q const& key, Less pred )
{
- return find_at( &m_Head, val, cds::opt::details::make_comparator_from_less<Less>() );
+ return find_at( &m_Head, key, cds::opt::details::make_comparator_from_less<Less>() );
}
- /// Finds the key \p val and return the item found
+ /// Finds \p key and return the item found
/** \anchor cds_intrusive_LazyList_hp_get
- The function searches the item with key equal to \p val
+ The function searches the item with key equal to \p key
and assigns the item found to guarded pointer \p ptr.
- The function returns \p true if \p val is found, and \p false otherwise.
- If \p val is not found the \p ptr parameter is not changed.
+ The function returns \p true if \p key is found, and \p false otherwise.
+ If \p key is not found the \p ptr parameter is not changed.
The \ref disposer specified in \p Traits class template parameter is called
by garbage collector \p GC automatically when returned \ref guarded_ptr object
should accept a parameter of type \p Q that can be not the same as \p value_type.
*/
template <typename Q>
- bool get( guarded_ptr& ptr, Q const& val )
+ bool get( guarded_ptr& ptr, Q const& key )
{
- return get_at( &m_Head, ptr.guard(), val, key_comparator() );
+ return get_at( &m_Head, ptr.guard(), key, key_comparator() );
}
- /// Finds the key \p val and return the item found
+ /// Finds \p key and return the item found
/**
The function is an analog of \ref cds_intrusive_LazyList_hp_get "get( guarded_ptr& ptr, Q const&)"
but \p pred is used for comparing the keys.
\p pred must imply the same element order as the comparator used for building the list.
*/
template <typename Q, typename Less>
- bool get_with( guarded_ptr& ptr, Q const& val, Less pred )
+ bool get_with( guarded_ptr& ptr, Q const& key, Less pred )
{
- return get_at( &m_Head, ptr.guard(), val, cds::opt::details::make_comparator_from_less<Less>() );
+ return get_at( &m_Head, ptr.guard(), key, cds::opt::details::make_comparator_from_less<Less>() );
}
/// Clears the list
- /**
- The function unlink all items from the list.
- */
void clear()
{
typename gc::Guard guard;
/// Returns list's item count
/**
- The value returned depends on opt::item_counter option. For atomicity::empty_item_counter,
+ The value returned depends on item counter provided by \p Traits. For \p atomicity::empty_item_counter,
this function always returns 0.
- <b>Warning</b>: even if you use real item counter and it returns 0, this fact is not mean that the list
- is empty. To check list emptyness use \ref empty() method.
+ @note Even if you use real item counter and it returns 0, this fact does not mean that the list
+ is empty. To check list emptyness use \p empty() method.
*/
size_t size() const
{
assert( pNode != nullptr );
// Hack: convert node_type to value_type.
- // In principle, auxiliary node can be non-reducible to value_type
- // We assume that comparator can correctly distinguish aux and regular node.
+ // In principle, auxiliary node cannot be reducible to value_type
+ // We assume that internal comparator can correctly distinguish aux and regular node.
return insert_at( pHead, *node_traits::to_value_ptr( pNode ) );
}
namespace cds { namespace intrusive {
namespace lazy_list {
- /// Lazy list node for gc::nogc
+ /// Lazy list node for \p gc::nogc
/**
Template parameters:
- - Tag - a tag used to distinguish between different implementation
+ - Lock - lock type. Default is \p cds::lock::Spin
+ - Tag - a \ref cds_intrusive_hook_tag "tag"
*/
- template <typename Lock, typename Tag>
+ template <
+#ifdef CDS_DOXYGEN_INVOKED
+ typename Lock = cds::lock::Spin,
+ typename Tag = opt::none
+#else
+ typename Lock,
+ typename Tag
+#endif
+ >
struct node<gc::nogc, Lock, Tag>
{
- typedef gc::nogc gc ; ///< Garbage collector
- typedef Lock lock_type ; ///< Lock type
- typedef Tag tag ; ///< tag
+ typedef gc::nogc gc; ///< Garbage collector
+ typedef Lock lock_type; ///< Lock type
+ typedef Tag tag; ///< tag
- atomics::atomic<node *> m_pNext ; ///< pointer to the next node in the list
- mutable lock_type m_Lock ; ///< Node lock
+ atomics::atomic<node *> m_pNext; ///< pointer to the next node in the list
+ mutable lock_type m_Lock; ///< Node lock
node()
: m_pNext( nullptr )
} // namespace lazy_list
- /// Lazy ordered single-linked list (template specialization for gc::nogc)
+ /// Lazy ordered single-linked list (template specialization for \p gc::nogc)
/** @ingroup cds_intrusive_list
\anchor cds_intrusive_LazyList_nogc
- This specialization is intended for so-called persistent usage when no item
+ This specialization is append-only list when no item
reclamation may be performed. The class does not support deleting of list item.
See \ref cds_intrusive_LazyList_hp "LazyList" for description of template parameters.
-
- The interface of the specialization is a slightly different.
-
- The gc::nogc specialization of LazyList accepts following template argument list
- \p Options of cds::intrusive::lazy_list::make_traits metafunction:
- - opt::hook - hook used. Possible values are: lazy_list::base_hook, lazy_list::member_hook, lazy_list::traits_hook.
- If the option is not specified, <tt>lazy_list::base_hook<></tt> and gc::HP is used.
- - opt::compare - key comparison functor. No default functor is provided.
- If the option is not specified, the opt::less is used.
- - opt::less - specifies binary predicate used for key comparison. Default is \p std::less<T>.
- - opt::back_off - back-off strategy used. If the option is not specified, the cds::backoff::empty is used.
- - opt::disposer - the functor used for dispose removed items. Default is opt::v::empty_disposer. The disposer
- provided is used only in \ref clear() function.
- - opt::link_checker - the type of node's link fields checking. Default is \ref opt::debug_check_link
- - opt::item_counter - the type of item counting feature. Default is \ref atomicity::empty_item_counter that is no item counting.
- - opt::memory_model - C++ memory ordering model. Can be opt::v::relaxed_ordering (relaxed memory model, the default)
- or opt::v::sequential_consistent (sequentially consisnent memory model).
-
- The opt::allocator and opt::back_off is not used for this specialization.
-
*/
template <
typename T
#ifdef CDS_DOXYGEN_INVOKED
- ,class Traits = lazy_list::type_traits
+ ,class Traits = lazy_list::traits
#else
,class Traits
#endif
class LazyList<gc::nogc, T, Traits>
{
public:
- typedef T value_type ; ///< type of value stored in the list
- typedef Traits options ; ///< Traits template parameter
+ typedef gc::nogc gc; ///< Garbage collector
+ typedef T value_type; ///< type of value stored in the list
+ typedef Traits traits; ///< Traits template parameter
- typedef typename options::hook hook ; ///< hook type
- typedef typename hook::node_type node_type ; ///< node type
+ typedef typename traits::hook hook; ///< hook type
+ typedef typename hook::node_type node_type; ///< node type
# ifdef CDS_DOXYGEN_INVOKED
typedef implementation_defined key_comparator ; ///< key comparison functor based on opt::compare and opt::less option setter.
# else
- typedef typename opt::details::make_comparator< value_type, options >::type key_comparator;
+ typedef typename opt::details::make_comparator< value_type, traits >::type key_comparator;
# endif
- typedef typename options::disposer disposer ; ///< disposer used
- typedef typename get_node_traits< value_type, node_type, hook>::type node_traits ; ///< node traits
- typedef typename lazy_list::get_link_checker< node_type, options::link_checker >::type link_checker ; ///< link checker
+ typedef typename traits::disposer disposer; ///< disposer
+ typedef typename get_node_traits< value_type, node_type, hook>::type node_traits; ///< node traits
+ typedef typename lazy_list::get_link_checker< node_type, traits::link_checker >::type link_checker; ///< link checker
- typedef gc::nogc gc ; ///< Garbage collector
- typedef typename options::back_off back_off ; ///< back-off strategy (not used)
- typedef typename options::item_counter item_counter ; ///< Item counting policy used
- typedef typename options::memory_model memory_model; ///< C++ memory ordering (see lazy_list::type_traits::memory_model)
+ typedef typename traits::item_counter item_counter; ///< Item counting policy used
+ typedef typename traits::memory_model memory_model; ///< C++ memory ordering (see lazy_list::traits::memory_model)
//@cond
- // Rebind options (split-list support)
+ // Rebind traits (split-list support)
template <typename... Options>
struct rebind_options {
typedef LazyList<
gc
, value_type
- , typename cds::opt::make_options< options, Options...>::type
+ , typename cds::opt::make_options< traits, Options...>::type
> type;
};
//@endcond
typedef node_type * auxiliary_head ; ///< Auxiliary head type (for split-list support)
protected:
- node_type m_Head ; ///< List head (dummy node)
- node_type m_Tail; ///< List tail (dummy node)
- item_counter m_ItemCounter ; ///< Item counter
+ node_type m_Head; ///< List head (dummy node)
+ node_type m_Tail; ///< List tail (dummy node)
+ item_counter m_ItemCounter; ///< Item counter
//@cond
LazyList()
{
static_assert( (std::is_same< gc, typename node_type::gc >::value), "GC and node_type::gc must be the same type" );
-
m_Head.m_pNext.store( &m_Tail, memory_model::memory_order_relaxed );
}
~LazyList()
{
clear();
-
assert( m_Head.m_pNext.load(memory_model::memory_order_relaxed) == &m_Tail );
m_Head.m_pNext.store( nullptr, memory_model::memory_order_relaxed );
}
The functor may change non-key fields of the \p item.
While the functor \p f is calling the item \p item is locked.
- You may pass \p func argument by reference using \p std::ref.
-
Returns <tt> std::pair<bool, bool> </tt> where \p first is true if operation is successfull,
\p second is true if new item has been added or \p false if the item with \p key
already is in the list.
return ensure_at( &m_Head, val, func );
}
- /// Finds the key \p val
+ /// Finds the key \p key
/** \anchor cds_intrusive_LazyList_nogc_find_func
- The function searches the item with key equal to \p val
- and calls the functor \p f for item found.
- The interface of \p Func functor is:
- \code
- struct functor {
- void operator()( value_type& item, Q& val );
- };
- \endcode
- where \p item is the item found, \p val 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.
- While the functor \p f is calling the item found \p item is locked.
-
- The function returns \p true if \p val is found, \p false otherwise.
- */
- template <typename Q, typename Func>
- bool find( Q& val, Func f )
- {
- return find_at( &m_Head, val, key_comparator(), f );
- }
-
- /// Finds the key \p val
- /** \anchor cds_intrusive_LazyList_nogc_find_cfunc
- The function searches the item with key equal to \p val
+ The function searches the item with key equal to \p key
and calls the functor \p f for item found.
The interface of \p Func functor is:
\code
struct functor {
- void operator()( value_type& item, Q const& val );
+ void operator()( value_type& item, Q& key );
};
\endcode
- where \p item is the item found, \p val is the <tt>find</tt> function argument.
-
- You may pass \p f argument by reference using \p std::ref.
+ where \p item is the item found, \p key is the <tt>find</tt> function argument.
The functor may change non-key fields of \p item.
While the functor \p f is calling the item found \p item is locked.
- The function returns \p true if \p val is found, \p false otherwise.
+ The function returns \p true if \p key is found, \p false otherwise.
*/
template <typename Q, typename Func>
- bool find( Q const& val, Func f )
- {
- return find_at( &m_Head, val, key_comparator(), f );
- }
-
- /// Finds the key \p val using \p pred predicate for searching
- /**
- The function is an analog of \ref cds_intrusive_LazyList_nogc_find_cfunc "find(Q const&, Func)"
- but \p pred is used for key comparing.
- \p Less functor has the interface like \p std::less.
- \p pred must imply the same element order as the comparator used for building the list.
- */
- template <typename Q, typename Less, typename Func>
- bool find_with( Q const& val, Less pred, Func f )
+ bool find( Q& key, Func f )
{
- return find_at( &m_Head, val, cds::opt::details::make_comparator_from_less<Less>(), f );
+ return find_at( &m_Head, key, key_comparator(), f );
}
- /// Finds the key \p val using \p pred predicate for searching
+ /// Finds the key \p key using \p pred predicate for searching
/**
The function is an analog of \ref cds_intrusive_LazyList_nogc_find_func "find(Q&, Func)"
but \p pred is used for key comparing.
\p pred must imply the same element order as the comparator used for building the list.
*/
template <typename Q, typename Less, typename Func>
- bool find_with( Q& val, Less pred, Func f )
+ bool find_with( Q& key, Less pred, Func f )
{
- return find_at( &m_Head, val, cds::opt::details::make_comparator_from_less<Less>(), f );
+ return find_at( &m_Head, key, cds::opt::details::make_comparator_from_less<Less>(), f );
}
- /// Finds the key \p val
+ /// Finds the key \p key
/** \anchor cds_intrusive_LazyList_nogc_find_val
- The function searches the item with key equal to \p val
+ The function searches the item with key equal to \p key
and returns pointer to value found or \p nullptr.
*/
template <typename Q>
- value_type * find( Q const& val )
+ value_type * find( Q const& key )
{
- return find_at( &m_Head, val, key_comparator() );
+ return find_at( &m_Head, key, key_comparator() );
}
- /// Finds the key \p val using \p pred predicate for searching
+ /// Finds the key \p key using \p pred predicate for searching
/**
The function is an analog of \ref cds_intrusive_LazyList_nogc_find_val "find(Q const&)"
but \p pred is used for key comparing.
\p pred must imply the same element order as the comparator used for building the list.
*/
template <typename Q, typename Less>
- value_type * find_with( Q const & val, Less pred )
+ value_type * find_with( Q const & key, Less pred )
{
- return find_at( &m_Head, val, cds::opt::details::make_comparator_from_less<Less>() );
+ return find_at( &m_Head, key, cds::opt::details::make_comparator_from_less<Less>() );
}
/// Clears the list
Template arguments:
- \p RCU - one of \ref cds_urcu_gc "RCU type"
- \p T - type to be stored in the list
- - \p Traits - type traits. See lazy_list::type_traits for explanation.
+ - \p Traits - type traits. See \p lazy_list::traits for explanation.
It is possible to declare option-based list with \p %cds::intrusive::lazy_list::make_traits metafunction istead of \p Traits template
argument. Template argument list \p Options of cds::intrusive::lazy_list::make_traits metafunction are:
typename RCU
,typename T
#ifdef CDS_DOXYGEN_INVOKED
- ,class Traits = lazy_list::type_traits
+ ,class Traits = lazy_list::traits
#else
,class Traits
#endif
class LazyList<cds::urcu::gc<RCU>, T, Traits>
{
public:
- typedef T value_type ; ///< type of value stored in the list
- typedef Traits options ; ///< Traits template parameter
+ typedef cds::urcu::gc<RCU> gc; ///< RCU schema
+ typedef T value_type; ///< type of value stored in the list
+ typedef Traits traits; ///< Traits template parameter
- typedef typename options::hook hook ; ///< hook type
- typedef typename hook::node_type node_type ; ///< node type
+ typedef typename traits::hook hook; ///< hook type
+ typedef typename hook::node_type node_type; ///< node type
# ifdef CDS_DOXYGEN_INVOKED
typedef implementation_defined key_comparator ; ///< key compare functor based on opt::compare and opt::less option setter.
# else
- typedef typename opt::details::make_comparator< value_type, options >::type key_comparator;
+ typedef typename opt::details::make_comparator< value_type, traits >::type key_comparator;
# endif
- typedef typename options::disposer disposer ; ///< disposer used
- typedef typename get_node_traits< value_type, node_type, hook>::type node_traits ; ///< node traits
- typedef typename lazy_list::get_link_checker< node_type, options::link_checker >::type link_checker ; ///< link checker
+ typedef typename traits::disposer disposer; ///< disposer used
+ typedef typename get_node_traits< value_type, node_type, hook>::type node_traits; ///< node traits
+ typedef typename lazy_list::get_link_checker< node_type, traits::link_checker >::type link_checker; ///< link checker
- typedef cds::urcu::gc<RCU> gc ; ///< RCU schema
- typedef typename options::back_off back_off ; ///< back-off strategy (not used)
- typedef typename options::item_counter item_counter ; ///< Item counting policy used
- typedef typename options::memory_model memory_model ; ///< C++ memory ordering (see lazy_list::type_traits::memory_model)
- typedef typename options::rcu_check_deadlock rcu_check_deadlock ; ///< Deadlock checking policy
+ typedef typename traits::back_off back_off; ///< back-off strategy (not used)
+ typedef typename traits::item_counter item_counter; ///< Item counting policy used
+ typedef typename traits::memory_model memory_model; ///< C++ memory ordering (see \p lazy_list::traits::memory_model)
+ typedef typename traits::rcu_check_deadlock rcu_check_deadlock; ///< Deadlock checking policy
typedef typename gc::scoped_lock rcu_lock ; ///< RCU scoped lock
static CDS_CONSTEXPR const bool c_bExtractLockExternal = true; ///< Group of \p extract_xxx functions require external locking
//@cond
- // Rebind options (split-list support)
+ // Rebind traits (split-list support)
template <typename... Options>
struct rebind_options {
typedef LazyList<
gc
, value_type
- , typename cds::opt::make_options< options, Options...>::type
+ , typename cds::opt::make_options< traits, Options...>::type
> type;
};
//@endcond
protected:
- typedef typename node_type::marked_ptr marked_node_ptr ; ///< Node marked pointer
- typedef node_type * auxiliary_head ; ///< Auxiliary head type (for split-list support)
+ typedef typename node_type::marked_ptr marked_node_ptr; ///< Node marked pointer
+ typedef node_type * auxiliary_head; ///< Auxiliary head type (for split-list support)
protected:
- node_type m_Head ; ///< List head (dummy node)
- node_type m_Tail; ///< List tail (dummy node)
- item_counter m_ItemCounter ; ///< Item counter
+ node_type m_Head; ///< List head (dummy node)
+ node_type m_Tail; ///< List tail (dummy node)
+ item_counter m_ItemCounter; ///< Item counter
//@cond
/// Position pointer for item search
struct position {
- node_type * pPred ; ///< Previous node
- node_type * pCur ; ///< Current node
+ node_type * pPred; ///< Previous node
+ node_type * pCur; ///< Current node
/// Locks nodes \p pPred and \p pCur
void lock()
assert( pCur != &m_Tail );
node_type * pNext = pCur->m_pNext.load(memory_model::memory_order_relaxed).ptr();
- //pCur->m_pNext.store( marked_node_ptr( pNext, 1), memory_model::memory_order_relaxed) ; // logically deleting
- pCur->m_pNext.store( marked_node_ptr( pHead, 1 ), memory_model::memory_order_relaxed ) ; // logical deletion + back-link for search
+ pCur->m_pNext.store( marked_node_ptr( pHead, 1 ), memory_model::memory_order_relaxed ); // logical deletion + back-link for search
pPred->m_pNext.store( marked_node_ptr( pNext ), memory_model::memory_order_relaxed); // physically deleting
- //pCur->m_pNext.store( marked_node_ptr( pHead, 1 ), memory_model::memory_order_relaxed ) ; // back-link for search
}
//@endcond
where \p val is the item inserted.
While the functor \p f is working the item \p val is locked.
The user-defined functor is called only if the inserting is success.
-
- @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
*/
template <typename Func>
bool insert( value_type& val, Func f )
Returns <tt> std::pair<bool, bool> </tt> where \p first is true if operation is successfull,
\p second is true if new item has been added or \p false if the item with \p key
already is in the list.
-
- @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
*/
template <typename Func>
/// Deletes the item from the list
/** \anchor cds_intrusive_LazyList_rcu_find_erase
- The function searches an item with key equal to \p val in the list,
+ The function searches an item with key equal to \p key in the list,
unlinks it from the list, and returns \p true.
- If the item with the key equal to \p val is not found the function return \p false.
+ If the item with the key equal to \p key is not found the function return \p false.
RCU \p synchronize method can be called.
Note that depending on RCU type used the \ref disposer call can be deferred.
deadlock checking policy is opt::v::rcu_throw_deadlock.
*/
template <typename Q>
- bool erase( Q const& val )
+ bool erase( Q const& key )
{
- return erase_at( &m_Head, val, key_comparator() );
+ return erase_at( &m_Head, key, key_comparator() );
}
/// Deletes the item from the list using \p pred predicate for searching
\p pred must imply the same element order as the comparator used for building the list.
*/
template <typename Q, typename Less>
- bool erase_with( Q const& val, Less pred )
+ bool erase_with( Q const& key, Less pred )
{
- return erase_at( &m_Head, val, cds::opt::details::make_comparator_from_less<Less>());
+ return erase_at( &m_Head, key, cds::opt::details::make_comparator_from_less<Less>());
}
/// Deletes the item from the list
/** \anchor cds_intrusive_LazyList_rcu_find_erase_func
- The function searches an item with key equal to \p val in the list,
+ The function searches an item with key equal to \p key in the list,
call \p func functor with item found, unlinks it from the list, and returns \p true.
The \p Func interface is
\code
void operator()( value_type const& item );
};
\endcode
- The functor may be passed by reference using <tt>boost:ref</tt>
- If the item with the key equal to \p val is not found the function return \p false.
+ If the item with the key equal to \p key is not found the function return \p false.
RCU \p synchronize method can be called.
Note that depending on RCU type used the \ref disposer call can be deferred.
deadlock checking policy is opt::v::rcu_throw_deadlock.
*/
template <typename Q, typename Func>
- bool erase( Q const& val, Func func )
+ bool erase( Q const& key, Func func )
{
- return erase_at( &m_Head, val, key_comparator(), func );
+ return erase_at( &m_Head, key, key_comparator(), func );
}
/// Deletes the item from the list using \p pred predicate for searching
\p pred must imply the same element order as the comparator used for building the list.
*/
template <typename Q, typename Less, typename Func>
- bool erase_with( Q const& val, Less pred, Func func )
+ bool erase_with( Q const& key, Less pred, Func func )
{
- return erase_at( &m_Head, val, cds::opt::details::make_comparator_from_less<Less>(), func );
+ return erase_at( &m_Head, key, cds::opt::details::make_comparator_from_less<Less>(), func );
}
/// Extracts an item from the list
/**
\anchor cds_intrusive_LazyList_rcu_extract
- The function searches an item with key equal to \p val in the list,
+ The function searches an item with key equal to \p key in the list,
unlinks it from the list, and returns pointer to an item found in \p dest parameter.
- If the item with the key equal to \p val is not found the function returns \p false,
+ If the item with the key equal to \p key is not found the function returns \p false,
\p dest is empty.
@note The function does NOT call RCU read-side lock or synchronization,
\endcode
*/
template <typename Q>
- bool extract( exempt_ptr& dest, Q const& val )
+ bool extract( exempt_ptr& dest, Q const& key )
{
- dest = extract_at( &m_Head, val, key_comparator() );
+ dest = extract_at( &m_Head, key, key_comparator() );
return !dest.empty();
}
\p pred must imply the same element order as \ref key_comparator.
*/
template <typename Q, typename Less>
- bool extract_with( exempt_ptr& dest, Q const& val, Less pred )
+ bool extract_with( exempt_ptr& dest, Q const& key, Less pred )
{
- dest = extract_at( &m_Head, val, cds::opt::details::make_comparator_from_less<Less>() );
+ dest = extract_at( &m_Head, key, cds::opt::details::make_comparator_from_less<Less>() );
return !dest.empty();
}
- /// Finds the key \p val
+ /// Finds the key \p key
/** \anchor cds_intrusive_LazyList_rcu_find_func
- The function searches the item with key equal to \p val
+ The function searches the item with key equal to \p key
and calls the functor \p f for item found.
The interface of \p Func functor is:
\code
struct functor {
- void operator()( value_type& item, Q& val );
+ void operator()( value_type& item, Q& key );
};
\endcode
- where \p item is the item found, \p val is the <tt>find</tt> function argument.
+ 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.
While the functor \p f is calling the item found \p item is locked.
- The function returns \p true if \p val is found, \p false otherwise.
+ The function returns \p true if \p key is found, \p false otherwise.
*/
template <typename Q, typename Func>
- bool find( Q& val, Func f ) const
+ bool find( Q& key, Func f ) const
{
- return find_at( const_cast<node_type *>( &m_Head ), val, key_comparator(), f );
+ return find_at( const_cast<node_type *>( &m_Head ), key, key_comparator(), f );
}
- /// Finds the key \p val using \p pred predicate for searching
+ /// Finds the key \p key using \p pred predicate for searching
/**
The function is an analog of \ref cds_intrusive_LazyList_rcu_find_func "find(Q&, Func)"
but \p pred is used for key comparing.
\p pred must imply the same element order as the comparator used for building the list.
*/
template <typename Q, typename Less, typename Func>
- bool find_with( Q& val, Less pred, Func f ) const
- {
- return find_at( const_cast<node_type *>( &m_Head ), val, cds::opt::details::make_comparator_from_less<Less>(), f );
- }
-
- /// Finds the key \p val
- /** \anchor cds_intrusive_LazyList_rcu_find_cfunc
- The function searches the item with key equal to \p val
- and calls the functor \p f for item found.
- The interface of \p Func functor is:
- \code
- struct functor {
- void operator()( value_type& item, Q const& val );
- };
- \endcode
- where \p item is the item found, \p val 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.
- While the functor \p f is calling the item found \p item is locked.
-
- The function returns \p true if \p val is found, \p false otherwise.
- */
- template <typename Q, typename Func>
- bool find( Q const& val, Func f ) const
- {
- return find_at( const_cast<node_type *>( &m_Head ), val, key_comparator(), f );
- }
-
- /// Finds the key \p val using \p pred predicate for searching
- /**
- The function is an analog of \ref cds_intrusive_LazyList_rcu_find_cfunc "find(Q&, Func)"
- but \p pred is used for key comparing.
- \p Less functor has the interface like \p std::less.
- \p pred must imply the same element order as the comparator used for building the list.
- */
- template <typename Q, typename Less, typename Func>
- bool find_with( Q const& val, Less pred, Func f ) const
+ bool find_with( Q& key, Less pred, Func f ) const
{
- return find_at( const_cast<node_type *>( &m_Head ), val, cds::opt::details::make_comparator_from_less<Less>(), f );
+ return find_at( const_cast<node_type *>( &m_Head ), key, cds::opt::details::make_comparator_from_less<Less>(), f );
}
- /// Finds the key \p val
+ /// Finds the key \p key
/** \anchor cds_intrusive_LazyList_rcu_find_val
- The function searches the item with key equal to \p val
- and returns \p true if \p val found or \p false otherwise.
+ The function searches the item with key equal to \p key
+ and returns \p true if \p key found or \p false otherwise.
*/
template <typename Q>
- bool find( Q const& val ) const
+ bool find( Q const& key ) const
{
- return find_at( const_cast<node_type *>( &m_Head ), val, key_comparator() );
+ return find_at( const_cast<node_type *>( &m_Head ), key, key_comparator() );
}
- /// Finds the key \p val using \p pred predicate for searching
+ /// Finds the key \p key using \p pred predicate for searching
/**
The function is an analog of \ref cds_intrusive_LazyList_rcu_find_val "find(Q const&)"
but \p pred is used for key comparing.
\p pred must imply the same element order as the comparator used for building the list.
*/
template <typename Q, typename Less>
- bool find_with( Q const& val, Less pred ) const
+ bool find_with( Q const& key, Less pred ) const
{
- return find_at( const_cast<node_type *>( &m_Head ), val, cds::opt::details::make_comparator_from_less<Less>() );
+ return find_at( const_cast<node_type *>( &m_Head ), key, cds::opt::details::make_comparator_from_less<Less>() );
}
- /// Finds the key \p val and return the item found
+ /// Finds the key \p key and return the item found
/** \anchor cds_intrusive_LazyList_rcu_get
- The function searches the item with key equal to \p val and returns the pointer to item found.
- If \p val is not found it returns \p nullptr.
+ The function searches the item with key equal to \p key and returns the pointer to item found.
+ If \p key is not found it returns \p nullptr.
Note the compare functor should accept a parameter of type \p Q that can be not the same as \p value_type.
\endcode
*/
template <typename Q>
- value_type * get( Q const& val ) const
+ value_type * get( Q const& key ) const
{
- return get_at( const_cast<node_type *>( &m_Head ), val, key_comparator());
+ return get_at( const_cast<node_type *>( &m_Head ), key, key_comparator());
}
- /// Finds the key \p val and return the item found
+ /// Finds the key \p key and return the item found
/**
The function is an analog of \ref cds_intrusive_LazyList_rcu_get "get(Q const&)"
but \p pred is used for comparing the keys.
\p pred must imply the same element order as the comparator used for building the list.
*/
template <typename Q, typename Less>
- value_type * get_with( Q const& val, Less pred ) const
+ value_type * get_with( Q const& key, Less pred ) const
{
- return get_at( const_cast<node_type *>( &m_Head ), val, cds::opt::details::make_comparator_from_less<Less>());
+ return get_at( const_cast<node_type *>( &m_Head ), key, cds::opt::details::make_comparator_from_less<Less>());
}
/// Clears the list using default disposer
void IntrusiveLazyListHeaderTest::DHP_base_cmp()
{
typedef base_int_item< cds::gc::DHP > item;
- typedef ci::LazyList< cds::gc::DHP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::DHP> > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
+ struct traits : public ci::lazy_list::traits
+ {
+ typedef ci::lazy_list::base_hook< co::gc<cds::gc::DHP> > hook;
+ typedef cmp<item> compare;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::LazyList< cds::gc::DHP, item, traits > list;
test_int<list>();
}
void IntrusiveLazyListHeaderTest::DHP_base_less()
void IntrusiveLazyListHeaderTest::HP_base_cmp()
{
typedef base_int_item< cds::gc::HP > item;
- typedef ci::LazyList< cds::gc::HP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::HP> > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
+ struct traits : public ci::lazy_list::traits
+ {
+ typedef ci::lazy_list::base_hook< co::gc<cds::gc::HP> > hook;
+ typedef cmp<item> compare;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::LazyList< cds::gc::HP, item, traits > list;
test_int<list>();
}
void IntrusiveLazyListHeaderTest::HP_base_less()
void IntrusiveLazyListHeaderTest::HP_member_less()
{
typedef member_int_item< cds::gc::HP > item;
- typedef ci::LazyList< cds::gc::HP
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::member_hook<
- offsetof( item, hMember ),
- co::gc<cds::gc::HP>
- > >
- ,co::less< less<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
+ struct traits : public ci::lazy_list::traits
+ {
+ typedef ci::lazy_list::member_hook< offsetof( item, hMember ), co::gc<cds::gc::HP>> hook;
+ typedef IntrusiveLazyListHeaderTest::less<item> less;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::LazyList< cds::gc::HP, item, traits > list;
test_int<list>();
}
void IntrusiveLazyListHeaderTest::HP_member_cmpmix()
void IntrusiveLazyListHeaderTest::nogc_base_cmp()
{
typedef base_int_item< cds::gc::nogc > item;
- typedef ci::LazyList< cds::gc::nogc
- ,item
- ,ci::lazy_list::make_traits<
- ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > >
- ,co::compare< cmp<item> >
- ,ci::opt::disposer< faked_disposer >
- >::type
- > list;
+ struct traits : public ci::lazy_list::traits {
+ typedef ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > hook;
+ typedef cmp<item> compare;
+ typedef faked_disposer disposer;
+ };
+ typedef ci::LazyList< cds::gc::nogc, item, traits > list;
test_nogc_int<list>();
}
void IntrusiveLazyListHeaderTest::nogc_base_less()
{
typedef base_int_item< cds::gc::nogc > item;
- typedef ci::LazyList< cds::gc::nogc
- ,item
- ,ci::lazy_list::make_traits<
+ struct traits: public
+ ci::lazy_list::make_traits<
ci::opt::hook< ci::lazy_list::base_hook< co::gc<cds::gc::nogc> > >
,co::less< less<item> >
,ci::opt::disposer< faked_disposer >
>::type
- > list;
+ {};
+ typedef ci::LazyList< cds::gc::nogc, item, traits > list;
test_nogc_int<list>();
}
void IntrusiveLazyListHeaderTest::nogc_base_cmpmix()