Move michael_list_base.h from cds/container to cds/container/details
[libcds.git] / cds / container / michael_list_nogc.h
index e18a10da66463bd417deae2194999fc5d06c90d1..abae2284d09283d229c7b1e6e5bb4a474d5901ea 100644 (file)
@@ -4,7 +4,7 @@
 #define __CDS_CONTAINER_MICHAEL_LIST_NOGC_H
 
 #include <memory>
-#include <cds/container/michael_list_base.h>
+#include <cds/container/details/michael_list_base.h>
 #include <cds/intrusive/michael_list_nogc.h>
 #include <cds/container/details/make_michael_list.h>
 
@@ -75,25 +75,6 @@ namespace cds { namespace container {
         typedef typename base_class::atomic_node_ptr head_type;
         //@endcond
 
-    protected:
-        //@cond
-#   ifndef CDS_CXX11_LAMBDA_SUPPORT
-        struct ensure_functor
-        {
-            node_type * m_pItemFound;
-
-            ensure_functor()
-                : m_pItemFound( NULL )
-            {}
-
-            void operator ()(bool, node_type& item, node_type& )
-            {
-                m_pItemFound = &item;
-            }
-        };
-#   endif
-        //@endcond
-
     protected:
         //@cond
         static node_type * alloc_node()
@@ -106,13 +87,11 @@ namespace cds { namespace container {
             return cxx_allocator().New( v );
         }
 
-#   ifdef CDS_EMPLACE_SUPPORT
         template <typename... Args>
         static node_type * alloc_node( Args&&... args )
         {
             return cxx_allocator().MoveNew( std::forward<Args>(args)... );
         }
-#   endif
 
         static void free_node( node_type * pNode )
         {
@@ -174,7 +153,7 @@ namespace cds { namespace container {
             value_ptr operator ->() const
             {
                 typename iterator_base::value_ptr p = iterator_base::operator ->();
-                return p ? &(p->m_Value) : reinterpret_cast<value_ptr>(NULL);
+                return p ? &(p->m_Value) : nullptr;
             }
 
             value_ref operator *() const
@@ -233,7 +212,7 @@ namespace cds { namespace container {
         /// Returns an iterator that addresses the location succeeding the last element in a list
         /**
             Do not use the value returned by <tt>end</tt> function to access any item.
-            Internally, <tt>end</tt> returning value equals to <tt>NULL</tt>.
+            Internally, <tt>end</tt> returning value equals to \p nullptr.
 
             The returned value can be used only to control reaching the end of the list.
             For empty list \code begin() == end() \endcode
@@ -323,20 +302,15 @@ namespace cds { namespace container {
             return std::make_pair( node_to_iterator( ret.first ), ret.second );
         }
 
-#   ifdef CDS_EMPLACE_SUPPORT
         /// Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt>
         /**
             Return an iterator pointing to inserted item if success \ref end() otherwise
-
-            This function is available only for compiler that supports
-            variadic template and move semantics
         */
         template <typename... Args>
         iterator emplace( Args&&... args )
         {
             return node_to_iterator( emplace_at( head(), std::forward<Args>(args)... ));
         }
-#   endif
 
         /// Find the key \p val
         /** \anchor cds_nonintrusive_MichaelList_nogc_find_val
@@ -415,13 +389,7 @@ namespace cds { namespace container {
             scoped_node_ptr pNode( alloc_node( val ));
             node_type * pItemFound = nullptr;
 
-#   ifdef CDS_CXX11_LAMBDA_SUPPORT
             std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode, [&pItemFound](bool, node_type& item, node_type&) { pItemFound = &item; });
-#   else
-            ensure_functor func;
-            std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode, boost::ref(func) );
-            pItemFound = func.m_pItemFound;
-#   endif
             assert( pItemFound != nullptr );
 
             if ( ret.first && ret.second )
@@ -429,13 +397,11 @@ namespace cds { namespace container {
             return std::make_pair( pItemFound, ret.second );
         }
 
-#   ifdef CDS_EMPLACE_SUPPORT
         template <typename... Args>
         node_type * emplace_at( head_type& refHead, Args&&... args )
         {
             return insert_node_at( refHead, alloc_node( std::forward<Args>(args)...));
         }
-#   endif
 
         template <typename Q, typename Compare>
         node_type * find_at( head_type& refHead, Q const& key, Compare cmp )