3 #ifndef CDSLIB_CONTAINER_DETAILS_MAKE_MICHAEL_LIST_H
4 #define CDSLIB_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 template <typename... Args>
32 node_type( Args&&... args )
33 : m_Value( std::forward<Args>(args)... )
37 typedef Traits original_traits;
39 typedef typename original_traits::allocator::template rebind<node_type>::other allocator_type;
40 typedef cds::details::Allocator< node_type, allocator_type > cxx_allocator;
42 struct node_deallocator
44 void operator ()( node_type * pNode )
46 cxx_allocator().Delete( pNode );
50 typedef typename opt::details::make_comparator< value_type, original_traits >::type key_comparator;
54 value_type const & operator()( node_type const& node ) const
60 template <typename Less>
62 typedef cds::details::compare_wrapper< node_type, cds::opt::details::make_comparator_from_less<Less>, value_accessor > type;
65 struct intrusive_traits: public original_traits
67 typedef intrusive::michael_list::base_hook< opt::gc<gc> > hook;
68 typedef node_deallocator disposer;
69 typedef cds::details::compare_wrapper< node_type, key_comparator, value_accessor > compare;
70 static CDS_CONSTEXPR const opt::link_check_type link_checker = cds::intrusive::michael_list::traits::link_checker;
73 typedef intrusive::MichaelList<gc, node_type, intrusive_traits> type;
75 } // namespace details
78 }} // namespace cds::container
80 #endif // #ifndef CDSLIB_CONTAINER_DETAILS_MAKE_MICHAEL_LIST_H