Replace cds::ref/boost::ref with std::ref, remove cds::unref and cds/ref.h header
[libcds.git] / cds / container / lazy_kvlist_rcu.h
index 10d47ae441680b977a833eab52d53294c99062df..c93b2d395f7ad681950777c4caab62de116a910f 100644 (file)
@@ -4,10 +4,10 @@
 #define __CDS_CONTAINER_LAZY_KVLIST_RCU_H
 
 #include <memory>
+#include <functional>   // ref
 #include <cds/container/details/lazy_list_base.h>
 #include <cds/intrusive/lazy_list_rcu.h>
 #include <cds/container/details/make_lazy_kvlist.h>
-#include <cds/ref.h>
 #include <cds/details/functor_wrapper.h>
 
 namespace cds { namespace container {
@@ -398,7 +398,7 @@ namespace cds { namespace container {
             to the list's item inserted. <tt>item.second</tt> is a reference to item's value that may be changed.
             User-defined functor \p func should guarantee that during changing item's value no any other changes
             could be made on this list's item by concurrent threads.
-            The user-defined functor can be passed by reference using <tt>boost::ref</tt>
+            The user-defined functor can be passed by reference using \p std::ref
             and it is called only if inserting is successful.
 
             The key_type should be constructible from value of type \p K.
@@ -458,7 +458,7 @@ namespace cds { namespace container {
             however, \p func must guarantee that during changing no any other modifications
             could be made on this item by concurrent threads.
 
-            You may pass \p func argument by reference using <tt>boost::ref</tt>.
+            You may pass \p func argument by reference using \p std::ref
 
             The function makes RCU lock internally.
 
@@ -631,7 +631,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found.
 
-            You may pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You may pass \p f argument by reference using \p std::ref.
 
             The functor may change <tt>item.second</tt> that is reference to value of node.
             Note that the function is only guarantee that \p item cannot be deleted during functor is executing.
@@ -769,7 +769,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
-            if ( base_class::insert_at( &refHead, *pNode, [&f](node_type& node){ cds::unref(f)( node.m_Data ); } )) {
+            if ( base_class::insert_at( &refHead, *pNode, [&f](node_type& node){ f( node.m_Data ); } )) {
                 pNode.release();
                 return true;
             }
@@ -791,7 +791,7 @@ namespace cds { namespace container {
         template <typename K, typename Compare, typename Func>
         bool erase_at( head_type& refHead, K const & key, Compare cmp, Func f )
         {
-            return base_class::erase_at( &refHead, key, cmp, [&f](node_type const & node){cds::unref(f)( const_cast<value_type&>(node.m_Data)); });
+            return base_class::erase_at( &refHead, key, cmp, [&f](node_type const & node){f( const_cast<value_type&>(node.m_Data)); });
         }
 
         template <typename K, typename Func>
@@ -800,7 +800,7 @@ namespace cds { namespace container {
             scoped_node_ptr pNode( alloc_node( key ));
 
             std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode,
-                [&f]( bool bNew, node_type& node, node_type& ){ cds::unref(f)( bNew, node.m_Data ); });
+                [&f]( bool bNew, node_type& node, node_type& ){ f( bNew, node.m_Data ); });
             if ( ret.first && ret.second )
                 pNode.release();
 
@@ -822,7 +822,7 @@ namespace cds { namespace container {
         template <typename K, typename Compare, typename Func>
         bool find_at( head_type& refHead, K& key, Compare cmp, Func f ) const
         {
-            return base_class::find_at( &refHead, key, cmp, [&f]( node_type& node, K& ){ cds::unref(f)( node.m_Data ); });
+            return base_class::find_at( &refHead, key, cmp, [&f]( node_type& node, K& ){ f( node.m_Data ); });
         }
 
         template <typename K, typename Compare>