Merge branch 'check' into dev
[libcds.git] / cds / container / michael_set.h
index 91c7ef9453890564092a512118a84cf24d60f9c1..a7cff65359c46194d9c8de366a192709452c24d5 100644 (file)
@@ -304,7 +304,7 @@ namespace cds { namespace container {
             static_assert( std::is_same<gc, typename bucket_type::gc>::value, "GC and OrderedList::gc must be the same");
 
             // atomicity::empty_item_counter is not allowed as a item counter
-            static_assert( !std::is_same<item_counter, atomicity::empty_item_counter>::value, 
+            static_assert( !std::is_same<item_counter, atomicity::empty_item_counter>::value,
                            "cds::atomicity::empty_item_counter is not allowed as a item counter");
 
             m_Buckets = bucket_table_allocator().NewArray( bucket_count() );
@@ -349,7 +349,7 @@ namespace cds { namespace container {
                 void func( value_type& val );
             \endcode
             where \p val is the item inserted.
-            The user-defined functor is called only if the inserting is success. 
+            The user-defined functor is called only if the inserting is success.
 
             @warning For \ref cds_nonintrusive_MichaelList_gc "MichaelList" as the bucket see \ref cds_intrusive_item_creating "insert item troubleshooting".
             \ref cds_nonintrusive_LazyList_gc "LazyList" provides exclusive access to inserted item and does not require any node-level
@@ -560,8 +560,6 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p key is the <tt>find</tt> function argument.
 
-            You may pass \p f argument by reference using \p std::ref.
-
             The functor may change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
             The functor does not serialize simultaneous access to the set's \p item. If such access is
@@ -580,6 +578,13 @@ namespace cds { namespace container {
         {
             return bucket( key ).find( key, f );
         }
+        //@cond
+        template <typename Q, typename Func>
+        bool find( Q const& key, Func f )
+        {
+            return bucket( key ).find( key, f );
+        }
+        //@endcond
 
         /// Finds the key \p key using \p pred predicate for searching
         /**
@@ -593,6 +598,13 @@ namespace cds { namespace container {
         {
             return bucket( key ).find_with( key, pred, f );
         }
+        //@cond
+        template <typename Q, typename Less, typename Func>
+        bool find_with( Q const& key, Less pred, Func f )
+        {
+            return bucket( key ).find_with( key, pred, f );
+        }
+        //@endcond
 
         /// Finds the key \p key
         /** \anchor cds_nonintrusive_MichaelSet_find_val