Replace cds::ref/boost::ref with std::ref, remove cds::unref and cds/ref.h header
[libcds.git] / cds / intrusive / michael_list_nogc.h
index 67952fba5ff74c9fa42a1fa7c9ce16d1bf6072ea..89a5ae6b78f29141a073e70e252974688efb8ded 100644 (file)
@@ -3,7 +3,7 @@
 #ifndef __CDS_INTRUSIVE_MICHAEL_LIST_NOGC_H
 #define __CDS_INTRUSIVE_MICHAEL_LIST_NOGC_H
 
-#include <cds/intrusive/michael_list_base.h>
+#include <cds/intrusive/details/michael_list_base.h>
 #include <cds/gc/nogc.h>
 
 namespace cds { namespace intrusive {
@@ -20,7 +20,7 @@ namespace cds { namespace intrusive {
             typedef gc::nogc        gc  ;   ///< Garbage collector
             typedef Tag             tag ;   ///< tag
 
-            typedef CDS_ATOMIC::atomic< node * >   atomic_ptr  ;    ///< atomic marked pointer
+            typedef atomics::atomic< node * >   atomic_ptr  ;    ///< atomic marked pointer
 
             atomic_ptr m_pNext ; ///< pointer to the next node in the container
 
@@ -69,12 +69,12 @@ namespace cds { namespace intrusive {
 
         //@cond
         // Rebind options (split-list support)
-        template <CDS_DECL_OPTIONS7>
+        template <typename... Options>
         struct rebind_options {
             typedef MichaelList<
                 gc
                 , value_type
-                , typename cds::opt::make_options< options, CDS_OPTIONS7>::type
+                , typename cds::opt::make_options< options, Options...>::type
             >   type;
         };
         //@endcond
@@ -106,7 +106,7 @@ namespace cds { namespace intrusive {
         void dispose_node( node_type * pNode, Disposer disp )
         {
             clear_links( pNode );
-            cds::unref(disp)( node_traits::to_value_ptr( *pNode ));
+            disp( node_traits::to_value_ptr( *pNode ));
         }
 
         template <class Disposer>
@@ -121,7 +121,7 @@ namespace cds { namespace intrusive {
             link_checker::is_empty( pNode );
 
             pNode->m_pNext.store( pos.pCur, memory_model::memory_order_relaxed );
-            return pos.pPrev->compare_exchange_strong( pos.pCur, pNode, memory_model::memory_order_release, CDS_ATOMIC::memory_order_relaxed );
+            return pos.pPrev->compare_exchange_strong( pos.pCur, pNode, memory_model::memory_order_release, atomics::memory_order_relaxed );
         }
         //@endcond
 
@@ -316,7 +316,7 @@ namespace cds { namespace intrusive {
             The functor may change non-key fields of the \p item; however, \p func must guarantee
             that during changing no any other modifications could be made on this item by concurrent threads.
 
-            You can pass \p func argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p func argument by value or 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
@@ -341,7 +341,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item.
             The function \p find does not serialize simultaneous access to the list \p item. If such access is
@@ -380,7 +380,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item.
             The function \p find does not serialize simultaneous access to the list \p item. If such access is
@@ -530,7 +530,7 @@ namespace cds { namespace intrusive {
                 if ( search( refHead, val, key_comparator(), pos ) ) {
                     assert( key_comparator()( val, *node_traits::to_value_ptr( *pos.pCur ) ) == 0 );
 
-                    unref(func)( false, *node_traits::to_value_ptr( *pos.pCur ) , val );
+                    func( false, *node_traits::to_value_ptr( *pos.pCur ) , val );
                     return std::make_pair( iterator( pos.pCur ), false );
                 }
                 else {
@@ -538,7 +538,7 @@ namespace cds { namespace intrusive {
 
                     if ( link_node( node_traits::to_node_ptr( val ), pos ) ) {
                         ++m_ItemCounter;
-                        unref(func)( true, val , val );
+                        func( true, val , val );
                         return std::make_pair( iterator( node_traits::to_node_ptr( val )), true );
                     }
                 }
@@ -559,7 +559,7 @@ namespace cds { namespace intrusive {
 
             if ( search( refHead, val, cmp, pos ) ) {
                 assert( pos.pCur != nullptr );
-                unref(f)( *node_traits::to_value_ptr( *pos.pCur ), val );
+                f( *node_traits::to_value_ptr( *pos.pCur ), val );
                 return true;
             }
             return false;