From cb474f0551ae20b68284453b9ce48dbbff59c17d Mon Sep 17 00:00:00 2001 From: khizmax Date: Thu, 23 Oct 2014 22:32:53 +0400 Subject: [PATCH] MichaelList refactoring --- cds/container/michael_kvlist_nogc.h | 59 +++++++--------- cds/container/michael_kvlist_rcu.h | 68 ++++++++----------- cds/container/michael_list_nogc.h | 53 +++++++-------- .../ordered_list/hdr_michael_kv_nogc.cpp | 8 +-- .../ordered_list/hdr_michael_kv_rcu_gpb.cpp | 8 +-- .../ordered_list/hdr_michael_kv_rcu_gpi.cpp | 8 +-- .../ordered_list/hdr_michael_kv_rcu_gpt.cpp | 8 +-- .../ordered_list/hdr_michael_nogc.cpp | 8 +-- 8 files changed, 99 insertions(+), 121 deletions(-) diff --git a/cds/container/michael_kvlist_nogc.h b/cds/container/michael_kvlist_nogc.h index 26ac7dd0..ca1faa03 100644 --- a/cds/container/michael_kvlist_nogc.h +++ b/cds/container/michael_kvlist_nogc.h @@ -19,12 +19,12 @@ namespace cds { namespace container { typedef make_michael_kvlist base_maker; typedef typename base_maker::node_type node_type; - struct type_traits: public base_maker::type_traits + struct intrusive_traits: public base_maker::intrusive_traits { typedef typename base_maker::node_deallocator disposer; }; - typedef intrusive::MichaelList type; + typedef intrusive::MichaelList type; }; } // namespace details @@ -47,7 +47,7 @@ namespace cds { namespace container { typename Key, typename Value, #ifdef CDS_DOXYGEN_INVOKED - typename Traits = michael_list::type_traits + typename Traits = michael_list::traits #else typename Traits #endif @@ -60,34 +60,36 @@ namespace cds { namespace container { #endif { //@cond - typedef details::make_michael_kvlist_nogc< Key, Value, Traits > options; - typedef typename options::type base_class; + typedef details::make_michael_kvlist_nogc< Key, Value, Traits > maker; + typedef typename maker::type base_class; //@endcond public: + typedef cds::gc::nogc gc; ///< Garbage collector used + typedef Traits traits; ///< List traits + #ifdef CDS_DOXYGEN_INVOKED typedef Key key_type ; ///< Key type typedef Value mapped_type ; ///< Type of value stored in the list typedef std::pair value_type ; ///< key/value pair stored in the list #else - typedef typename options::key_type key_type; - typedef typename options::value_type mapped_type; - typedef typename options::pair_type value_type; + typedef typename maker::key_type key_type; + typedef typename maker::value_type mapped_type; + typedef typename maker::pair_type value_type; #endif - typedef typename base_class::gc gc ; ///< Garbage collector used - typedef typename base_class::back_off back_off ; ///< Back-off strategy used - typedef typename options::allocator_type allocator_type ; ///< Allocator type used for allocate/deallocate the nodes - typedef typename base_class::item_counter item_counter ; ///< Item counting policy used - typedef typename options::key_comparator key_comparator ; ///< key comparison functor - typedef typename base_class::memory_model memory_model ; ///< Memory ordering. See cds::opt::memory_model option + typedef typename base_class::back_off back_off; ///< Back-off strategy used + typedef typename maker::allocator_type allocator_type; ///< Allocator type used for allocate/deallocate the nodes + typedef typename base_class::item_counter item_counter; ///< Item counting policy used + typedef typename maker::key_comparator key_comparator; ///< key comparison functor + typedef typename base_class::memory_model memory_model; ///< Memory ordering. See cds::opt::memory_model option protected: //@cond - typedef typename base_class::value_type node_type; - typedef typename options::cxx_allocator cxx_allocator; - typedef typename options::node_deallocator node_deallocator; - typedef typename options::type_traits::compare intrusive_key_comparator; + typedef typename base_class::value_type node_type; + typedef typename maker::cxx_allocator cxx_allocator; + typedef typename maker::node_deallocator node_deallocator; + typedef typename maker::intrusive_traits::compare intrusive_key_comparator; typedef typename base_class::atomic_node_ptr head_type; //@endcond @@ -429,7 +431,7 @@ namespace cds { namespace container { return node_to_iterator( find_at( head(), key, intrusive_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_nonintrusive_MichaelKVList_nogc_find "find(Q const&)" but \p pred is used for key comparing. @@ -439,7 +441,7 @@ namespace cds { namespace container { template iterator find_with( Q const& key, Less pred ) { - return node_to_iterator( find_at( head(), key, typename options::template less_wrapper::type() ) ); + return node_to_iterator( find_at( head(), key, typename maker::template less_wrapper::type() ) ); } /// Check if the list is empty @@ -450,11 +452,11 @@ namespace cds { namespace container { /// 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. - Warning: 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 { @@ -462,9 +464,6 @@ namespace cds { namespace container { } /// Clears the list - /** - Post-condition: the list is empty - */ void clear() { base_class::clear(); @@ -530,14 +529,6 @@ namespace cds { namespace container { { return base_class::find_at( refHead, key, cmp ); } - - /* - template - bool find_at( head_type& refHead, K& key, Compare cmp, Func f ) - { - return base_class::find_at( refHead, key, cmp, [&f]( node_type& node, K const& ){ f( node.m_Data ); }); - } - */ //@endcond }; diff --git a/cds/container/michael_kvlist_rcu.h b/cds/container/michael_kvlist_rcu.h index 2bcdde40..04bc71a7 100644 --- a/cds/container/michael_kvlist_rcu.h +++ b/cds/container/michael_kvlist_rcu.h @@ -26,12 +26,12 @@ namespace cds { namespace container { - \p RCU - one of \ref cds_urcu_gc "RCU type" - \p Key - key type of an item stored in the list. It should be copy-constructible - \p Value - value type stored in a list - - \p Traits - type traits, default is michael_list::type_traits + - \p Traits - type traits, default is \p michael_list::traits @note Before including you should include appropriate RCU header file, see \ref cds_urcu_gc "RCU type" for list of existing RCU class and corresponding header files. - It is possible to declare option-based list with cds::container::michael_list::make_traits metafunction istead of \p Traits template + It is possible to declare option-based list using \p cds::container::michael_list::make_traits metafunction istead of \p Traits template argument. For example, the following traits-based declaration of Michael's list \code #include @@ -44,8 +44,8 @@ namespace cds { namespace container { } }; - // Declare type_traits - struct my_traits: public cds::container::michael_list::type_traits + // Declare traits + struct my_traits: public cds::container::michael_list::traits { typedef my_compare compare; }; @@ -68,24 +68,13 @@ namespace cds { namespace container { >::type > option_based_list; \endcode - - Template argument list \p Options of cds::container::michael_list::make_traits metafunction are: - - 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. - - opt::back_off - back-off strategy used. If the option is not specified, the cds::backoff::empty is used. - - opt::item_counter - the type of item counting feature. Default is \ref atomicity::empty_item_counter that is no item counting. - - opt::allocator - the allocator used for creating and freeing list's item. Default is \ref CDS_DEFAULT_ALLOCATOR macro. - - 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). - - opt::rcu_check_deadlock - a deadlock checking policy. Default is opt::v::rcu_throw_deadlock */ template < typename RCU, typename Key, typename Value, #ifdef CDS_DOXYGEN_INVOKED - typename Traits = michael_list::type_traits + typename Traits = michael_list::traits #else typename Traits #endif @@ -98,8 +87,8 @@ namespace cds { namespace container { #endif { //@cond - typedef details::make_michael_kvlist< cds::urcu::gc, Key, Value, Traits > options; - typedef typename options::type base_class; + typedef details::make_michael_kvlist< cds::urcu::gc, Key, Value, Traits > maker; + typedef typename maker::type base_class; //@endcond public: @@ -108,16 +97,17 @@ namespace cds { namespace container { typedef Value mapped_type ; ///< Type of value stored in the list typedef std::pair value_type ; ///< key/value pair stored in the list #else - typedef typename options::key_type key_type; - typedef typename options::value_type mapped_type; - typedef typename options::pair_type value_type; + typedef typename maker::key_type key_type; + typedef typename maker::value_type mapped_type; + typedef typename maker::pair_type value_type; #endif + typename Traits traits; ///< List traits typedef typename base_class::gc gc ; ///< Garbage collector used typedef typename base_class::back_off back_off ; ///< Back-off strategy used - typedef typename options::allocator_type allocator_type ; ///< Allocator type used for allocate/deallocate the nodes + typedef typename maker::allocator_type allocator_type; ///< Allocator type used for allocate/deallocate the nodes typedef typename base_class::item_counter item_counter ; ///< Item counting policy used - typedef typename options::key_comparator key_comparator ; ///< key comparison functor + typedef typename maker::key_comparator key_comparator; ///< key comparison functor typedef typename base_class::memory_model memory_model ; ///< Memory ordering. See cds::opt::memory_model option typedef typename base_class::rcu_check_deadlock rcu_check_deadlock ; ///< RCU deadlock checking policy @@ -127,16 +117,16 @@ namespace cds { namespace container { protected: //@cond typedef typename base_class::value_type node_type; - typedef typename options::cxx_allocator cxx_allocator; - typedef typename options::node_deallocator node_deallocator; - typedef typename options::type_traits::compare intrusive_key_comparator; + typedef typename maker::cxx_allocator cxx_allocator; + typedef typename maker::node_deallocator node_deallocator; + typedef typename maker::intrusive_traits::compare intrusive_key_comparator; typedef typename base_class::atomic_node_ptr head_type; //@endcond public: /// pointer to extracted node - typedef cds::urcu::exempt_ptr< gc, node_type, value_type, typename options::type_traits::disposer, + typedef cds::urcu::exempt_ptr< gc, node_type, value_type, typename maker::intrusive_traits::disposer, cds::urcu::details::conventional_exempt_pair_cast > exempt_ptr; @@ -475,7 +465,7 @@ namespace cds { namespace container { template bool erase_with( K const& key, Less pred ) { - return erase_at( head(), key, typename options::template less_wrapper::type() ); + return erase_at( head(), key, typename maker::template less_wrapper::type() ); } /// Deletes \p key from the list @@ -513,7 +503,7 @@ namespace cds { namespace container { template bool erase_with( K const& key, Less pred, Func f ) { - return erase_at( head(), key, typename options::template less_wrapper::type(), f ); + return erase_at( head(), key, typename maker::template less_wrapper::type(), f ); } /// Extracts an item from the list @@ -572,7 +562,7 @@ namespace cds { namespace container { template bool extract_with( exempt_ptr& dest, K const& key, Less pred ) { - dest = extract_at( head(), key, typename options::template less_wrapper::type() ); + dest = extract_at( head(), key, typename maker::template less_wrapper::type() ); return !dest.empty(); } @@ -590,7 +580,7 @@ namespace cds { namespace container { return find_at( head(), key, intrusive_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_nonintrusive_MichaelKVList_rcu_find_val "find(Q const&)" but \p pred is used for key comparing. @@ -600,10 +590,10 @@ namespace cds { namespace container { template bool find_with( Q const& key, Less pred ) const { - return find_at( head(), key, typename options::template less_wrapper::type() ); + return find_at( head(), key, typename maker::template less_wrapper::type() ); } - /// Finds the key \p key and performs an action with it + /// Finds \p key and performs an action with it /** \anchor cds_nonintrusive_MichaelKVList_rcu_find_func The function searches an item with key equal to \p key and calls the functor \p f for the item found. The interface of \p Func functor is: @@ -614,8 +604,6 @@ namespace cds { namespace container { \endcode where \p item is the item found. - You may pass \p f argument by reference using \p std::ref. - The functor may change item.second that is reference to value of node. Note that the function is only guarantee that \p item cannot be deleted during functor is executing. The function does not serialize simultaneous access to the list \p item. If such access is @@ -641,7 +629,7 @@ namespace cds { namespace container { template bool find_with( Q const& key, Less pred, Func f ) const { - return find_at( head(), key, typename options::template less_wrapper::type(), f ); + return find_at( head(), key, typename maker::template less_wrapper::type(), f ); } /// Finds \p key and return the item found @@ -689,7 +677,7 @@ namespace cds { namespace container { template value_type * get_with( K const& key, Less pred ) const { - return get_at( head(), key, typename options::template less_wrapper::type()); + return get_at( head(), key, typename maker::template less_wrapper::type() ); } /// Checks if the list is empty @@ -700,11 +688,11 @@ namespace cds { namespace container { /// 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. - Warning: 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 { diff --git a/cds/container/michael_list_nogc.h b/cds/container/michael_list_nogc.h index 13d6a60f..8bf852d0 100644 --- a/cds/container/michael_list_nogc.h +++ b/cds/container/michael_list_nogc.h @@ -19,12 +19,12 @@ namespace cds { namespace container { typedef make_michael_list base_maker; typedef typename base_maker::node_type node_type; - struct type_traits: public base_maker::type_traits + struct intrusive_traits: public base_maker::intrusive_traits { typedef typename base_maker::node_deallocator disposer; }; - typedef intrusive::MichaelList type; + typedef intrusive::MichaelList type; }; } // namespace details @@ -56,25 +56,27 @@ namespace cds { namespace container { #endif { //@cond - typedef details::make_michael_list_nogc< T, Traits > options; - typedef typename options::type base_class; + typedef details::make_michael_list_nogc< T, Traits > maker; + typedef typename maker::type base_class; //@endcond public: - typedef T value_type ; ///< Type of value stored in the list - typedef typename base_class::gc gc ; ///< Garbage collector used - typedef typename base_class::back_off back_off ; ///< Back-off strategy used - typedef typename options::allocator_type allocator_type ; ///< Allocator type used for allocate/deallocate the nodes - typedef typename base_class::item_counter item_counter ; ///< Item counting policy used - typedef typename options::key_comparator key_comparator ; ///< key comparison functor - typedef typename base_class::memory_model memory_model ; ///< Memory ordering. See cds::opt::memory_model option + typedef cds::gc::nogc gc; ///< Garbage collector used + typedef T value_type; ///< Type of value stored in the list + typedef Traits traits; ///< List traits + + typedef typename base_class::back_off back_off; ///< Back-off strategy used + typedef typename maker::allocator_type allocator_type; ///< Allocator type used for allocate/deallocate the nodes + typedef typename base_class::item_counter item_counter; ///< Item counting policy used + typedef typename maker::key_comparator key_comparator; ///< key comparison functor + typedef typename base_class::memory_model memory_model; ///< Memory ordering. See cds::opt::memory_model option protected: //@cond - typedef typename base_class::value_type node_type; - typedef typename options::cxx_allocator cxx_allocator; - typedef typename options::node_deallocator node_deallocator; - typedef typename options::type_traits::compare intrusive_key_comparator; + typedef typename base_class::value_type node_type; + typedef typename maker::cxx_allocator cxx_allocator; + typedef typename maker::node_deallocator node_deallocator; + typedef typename maker::intrusive_traits::compare intrusive_key_comparator; typedef typename base_class::atomic_node_ptr head_type; //@endcond @@ -295,7 +297,7 @@ namespace cds { namespace container { The operation inserts new item if the key \p val is not found in the list. Otherwise, the function returns an iterator that points to item found. - Returns std::pair where \p first is an iterator pointing to + Returns std::pair where \p first is an iterator pointing to item found or inserted, \p second is true if new item has been added or \p false if the item already is in the list. */ @@ -316,11 +318,11 @@ namespace cds { namespace container { return node_to_iterator( emplace_at( head(), std::forward(args)... )); } - /// Find the key \p val + /// Find the key \p key /** \anchor cds_nonintrusive_MichaelList_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 an iterator pointed to item found if the key is found, - and \ref end() otherwise + and \p end() otherwise */ template iterator find( Q const& key ) @@ -328,7 +330,7 @@ namespace cds { namespace container { return node_to_iterator( find_at( head(), key, intrusive_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_nonintrusive_MichaelList_nogc_find_val "find(Q const&)" but \p pred is used for key comparing. @@ -338,7 +340,7 @@ namespace cds { namespace container { template iterator find_with( Q const& key, Less pred ) { - return node_to_iterator( find_at( head(), key, typename options::template less_wrapper::type() )); + return node_to_iterator( find_at( head(), key, typename maker::template less_wrapper::type() ) ); } /// Check if the list is empty @@ -349,11 +351,11 @@ namespace cds { namespace container { /// Returns list's item count /** - The value returned depends on opt::item_counter option. For atomics::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. - Warning: 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 { @@ -361,9 +363,6 @@ namespace cds { namespace container { } /// Clears the list - /** - Post-condition: the list is empty - */ void clear() { base_class::clear(); diff --git a/tests/test-hdr/ordered_list/hdr_michael_kv_nogc.cpp b/tests/test-hdr/ordered_list/hdr_michael_kv_nogc.cpp index 3eed7668..cf654a92 100644 --- a/tests/test-hdr/ordered_list/hdr_michael_kv_nogc.cpp +++ b/tests/test-hdr/ordered_list/hdr_michael_kv_nogc.cpp @@ -5,7 +5,7 @@ namespace ordlist { namespace { - struct NOGC_cmp_traits: public cc::michael_list::type_traits + struct NOGC_cmp_traits : public cc::michael_list::traits { typedef MichaelKVListTestHeader::cmp compare; }; @@ -30,7 +30,7 @@ namespace ordlist { } namespace { - struct NOGC_less_traits: public cc::michael_list::type_traits + struct NOGC_less_traits : public cc::michael_list::traits { typedef MichaelKVListTestHeader::lt less; }; @@ -52,7 +52,7 @@ namespace ordlist { } namespace { - struct NOGC_cmpmix_traits: public cc::michael_list::type_traits + struct NOGC_cmpmix_traits : public cc::michael_list::traits { typedef MichaelKVListTestHeader::cmp compare; typedef MichaelKVListTestHeader::lt less; @@ -76,7 +76,7 @@ namespace ordlist { } namespace { - struct NOGC_ic_traits: public cc::michael_list::type_traits + struct NOGC_ic_traits : public cc::michael_list::traits { typedef MichaelKVListTestHeader::lt less; typedef cds::atomicity::item_counter item_counter; diff --git a/tests/test-hdr/ordered_list/hdr_michael_kv_rcu_gpb.cpp b/tests/test-hdr/ordered_list/hdr_michael_kv_rcu_gpb.cpp index c1141f8e..658a5efc 100644 --- a/tests/test-hdr/ordered_list/hdr_michael_kv_rcu_gpb.cpp +++ b/tests/test-hdr/ordered_list/hdr_michael_kv_rcu_gpb.cpp @@ -7,7 +7,7 @@ namespace ordlist { namespace { typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_type; - struct RCU_GPB_cmp_traits: public cc::michael_list::type_traits + struct RCU_GPB_cmp_traits : public cc::michael_list::traits { typedef MichaelKVListTestHeader::cmp compare; }; @@ -29,7 +29,7 @@ namespace ordlist { } namespace { - struct RCU_GPB_less_traits: public cc::michael_list::type_traits + struct RCU_GPB_less_traits : public cc::michael_list::traits { typedef MichaelKVListTestHeader::lt less; }; @@ -51,7 +51,7 @@ namespace ordlist { } namespace { - struct RCU_GPB_cmpmix_traits: public cc::michael_list::type_traits + struct RCU_GPB_cmpmix_traits : public cc::michael_list::traits { typedef MichaelKVListTestHeader::cmp compare; typedef MichaelKVListTestHeader::lt less; @@ -75,7 +75,7 @@ namespace ordlist { } namespace { - struct RCU_GPB_ic_traits: public cc::michael_list::type_traits + struct RCU_GPB_ic_traits : public cc::michael_list::traits { typedef MichaelKVListTestHeader::lt less; typedef cds::atomicity::item_counter item_counter; diff --git a/tests/test-hdr/ordered_list/hdr_michael_kv_rcu_gpi.cpp b/tests/test-hdr/ordered_list/hdr_michael_kv_rcu_gpi.cpp index a43472b8..fc080635 100644 --- a/tests/test-hdr/ordered_list/hdr_michael_kv_rcu_gpi.cpp +++ b/tests/test-hdr/ordered_list/hdr_michael_kv_rcu_gpi.cpp @@ -7,7 +7,7 @@ namespace ordlist { namespace { typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_type; - struct RCU_GPI_cmp_traits: public cc::michael_list::type_traits + struct RCU_GPI_cmp_traits : public cc::michael_list::traits { typedef MichaelKVListTestHeader::cmp compare; }; @@ -29,7 +29,7 @@ namespace ordlist { } namespace { - struct RCU_GPI_less_traits: public cc::michael_list::type_traits + struct RCU_GPI_less_traits : public cc::michael_list::traits { typedef MichaelKVListTestHeader::lt less; }; @@ -51,7 +51,7 @@ namespace ordlist { } namespace { - struct RCU_GPI_cmpmix_traits: public cc::michael_list::type_traits + struct RCU_GPI_cmpmix_traits : public cc::michael_list::traits { typedef MichaelKVListTestHeader::cmp compare; typedef MichaelKVListTestHeader::lt less; @@ -75,7 +75,7 @@ namespace ordlist { } namespace { - struct RCU_GPI_ic_traits: public cc::michael_list::type_traits + struct RCU_GPI_ic_traits : public cc::michael_list::traits { typedef MichaelKVListTestHeader::lt less; typedef cds::atomicity::item_counter item_counter; diff --git a/tests/test-hdr/ordered_list/hdr_michael_kv_rcu_gpt.cpp b/tests/test-hdr/ordered_list/hdr_michael_kv_rcu_gpt.cpp index 9d75f524..383c0857 100644 --- a/tests/test-hdr/ordered_list/hdr_michael_kv_rcu_gpt.cpp +++ b/tests/test-hdr/ordered_list/hdr_michael_kv_rcu_gpt.cpp @@ -7,7 +7,7 @@ namespace ordlist { namespace { typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_type; - struct RCU_GPT_cmp_traits: public cc::michael_list::type_traits + struct RCU_GPT_cmp_traits: public cc::michael_list::traits { typedef MichaelKVListTestHeader::cmp compare; }; @@ -29,7 +29,7 @@ namespace ordlist { } namespace { - struct RCU_GPT_less_traits: public cc::michael_list::type_traits + struct RCU_GPT_less_traits : public cc::michael_list::traits { typedef MichaelKVListTestHeader::lt less; }; @@ -51,7 +51,7 @@ namespace ordlist { } namespace { - struct RCU_GPT_cmpmix_traits: public cc::michael_list::type_traits + struct RCU_GPT_cmpmix_traits : public cc::michael_list::traits { typedef MichaelKVListTestHeader::cmp compare; typedef MichaelKVListTestHeader::lt less; @@ -75,7 +75,7 @@ namespace ordlist { } namespace { - struct RCU_GPT_ic_traits: public cc::michael_list::type_traits + struct RCU_GPT_ic_traits : public cc::michael_list::traits { typedef MichaelKVListTestHeader::lt less; typedef cds::atomicity::item_counter item_counter; diff --git a/tests/test-hdr/ordered_list/hdr_michael_nogc.cpp b/tests/test-hdr/ordered_list/hdr_michael_nogc.cpp index b3de14e1..1c28490b 100644 --- a/tests/test-hdr/ordered_list/hdr_michael_nogc.cpp +++ b/tests/test-hdr/ordered_list/hdr_michael_nogc.cpp @@ -5,7 +5,7 @@ namespace ordlist { namespace { - struct NOGC_cmp_traits: public cc::michael_list::type_traits + struct NOGC_cmp_traits: public cc::michael_list::traits { typedef MichaelListTestHeader::cmp compare; }; @@ -27,7 +27,7 @@ namespace ordlist { } namespace { - struct NOGC_less_traits: public cc::michael_list::type_traits + struct NOGC_less_traits: public cc::michael_list::traits { typedef MichaelListTestHeader::lt less; }; @@ -49,7 +49,7 @@ namespace ordlist { } namespace { - struct NOGC_cmpmix_traits: public cc::michael_list::type_traits + struct NOGC_cmpmix_traits: public cc::michael_list::traits { typedef MichaelListTestHeader::cmp compare; typedef MichaelListTestHeader::lt less; @@ -73,7 +73,7 @@ namespace ordlist { } namespace { - struct NOGC_ic_traits: public cc::michael_list::type_traits + struct NOGC_ic_traits: public cc::michael_list::traits { typedef MichaelListTestHeader::lt less; typedef cds::atomicity::item_counter item_counter; -- 2.34.1