add find(Q const&, Func), find_with(Q const&, Pred, Func) to all sets
[libcds.git] / cds / intrusive / michael_list_nogc.h
index 96ae276ef69b438e13f5712185a177e26a4f6fbe..17908a6d3b21521c52befed75162a75642478a49 100644 (file)
@@ -41,7 +41,7 @@ namespace cds { namespace intrusive {
 
         See \ref cds_intrusive_MichaelList_hp "MichaelList" for description of template parameters.
     */
-    template < typename T, 
+    template < typename T,
 #ifdef CDS_DOXYGEN_INVOKED
         class Traits = michael_list::traits
 #else
@@ -257,7 +257,7 @@ namespace cds { namespace intrusive {
             return const_iterator(m_pHead.load(memory_model::memory_order_relaxed) );
         }
         /// Returns a forward const iterator addressing the first element in a list
-        const_iterator cbegin()
+        const_iterator cbegin() const
         {
             return const_iterator(m_pHead.load(memory_model::memory_order_relaxed) );
         }
@@ -321,8 +321,6 @@ 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 \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
             already is in the list.
@@ -357,6 +355,13 @@ namespace cds { namespace intrusive {
         {
             return find_at( m_pHead, key, key_comparator(), f );
         }
+        //@cond
+        template <typename Q, typename Func>
+        bool find( Q const& key, Func f )
+        {
+            return find_at( m_pHead, key, key_comparator(), f );
+        }
+        //@endcond
 
         /// Finds the key \p key using \p pred predicate for searching
         /**
@@ -370,6 +375,13 @@ namespace cds { namespace intrusive {
         {
             return find_at( m_pHead, key, cds::opt::details::make_comparator_from_less<Less>(), f );
         }
+        //@cond
+        template <typename Q, typename Less, typename Func>
+        bool find_with( Q const& key, Less pred, Func f )
+        {
+            return find_at( m_pHead, key, cds::opt::details::make_comparator_from_less<Less>(), f );
+        }
+        //@endcond
 
         /// Finds \p key
         /** \anchor cds_intrusive_MichaelList_nogc_find_val