Implement find_with in nonintrusive and k/v lists.
[libcds.git] / cds / container / lazy_kvlist_nogc.h
index 3f8c67b0740b2b7f8b6c448c590241f9db68d829..d582180bd16dfb70be3355775c941ca92a30dc58 100644 (file)
@@ -426,6 +426,19 @@ namespace cds { namespace container {
             return node_to_iterator( find_at( head(), key, typename maker::template less_wrapper<Less>::type() ) );
         }
 
+        /// Finds the key \p val using \p equal predicate for searching
+        /**
+            The function is an analog of \ref cds_nonintrusive_LazyKVList_nogc_find "find(Q const&)"
+            but \p equal is used for key comparing.
+            \p Equal functor has the interface like \p std::equal_to.
+        */
+        template <typename Q, typename Equal, bool Sort = traits::sort>
+        typename std::enable_if<!Sort, iterator>::type find_with( Q const& key, Equal equal )
+        {
+            CDS_UNUSED( equal );
+            return node_to_iterator( find_at( head(), key, typename maker::template equal_to_wrapper<Equal>::type() ) );
+        }
+
         /// Check if the list is empty
         bool empty() const
         {