3 #ifndef __CDS_CONTAINER_DETAILS_MAKE_MICHAEL_LIST_H
4 #define __CDS_CONTAINER_DETAILS_MAKE_MICHAEL_LIST_H
6 #include <cds/details/binary_functor_wrapper.h>
8 namespace cds { namespace container {
13 template <class GC, typename T, class Traits>
14 struct make_michael_list
19 struct node_type : public intrusive::michael_list::node<gc>
27 node_type( Q const& v )
31 # ifdef CDS_EMPLACE_SUPPORT
32 template <typename... Args>
33 node_type( Args&&... args )
34 : m_Value( std::forward<Args>(args)... )
39 typedef Traits original_type_traits;
41 typedef typename original_type_traits::allocator::template rebind<node_type>::other allocator_type;
42 typedef cds::details::Allocator< node_type, allocator_type > cxx_allocator;
44 struct node_deallocator
46 void operator ()( node_type * pNode )
48 cxx_allocator().Delete( pNode );
52 typedef typename opt::details::make_comparator< value_type, original_type_traits >::type key_comparator;
56 value_type const & operator()( node_type const& node ) const
62 template <typename Less>
64 typedef cds::details::compare_wrapper< node_type, cds::opt::details::make_comparator_from_less<Less>, value_accessor > type;
67 struct type_traits: public original_type_traits
69 typedef intrusive::michael_list::base_hook< opt::gc<gc> > hook;
70 typedef node_deallocator disposer;
72 typedef cds::details::compare_wrapper< node_type, key_comparator, value_accessor > compare;
75 typedef intrusive::MichaelList<gc, node_type, type_traits> type;
77 } // namespace details
80 }} // namespace cds::container
82 #endif // #ifndef __CDS_CONTAINER_DETAILS_MAKE_MICHAEL_LIST_H