Replace cds::ref/boost::ref with std::ref, remove cds::unref and cds/ref.h header
authorkhizmax <libcds.dev@gmail.com>
Sun, 28 Sep 2014 14:30:55 +0000 (18:30 +0400)
committerkhizmax <libcds.dev@gmail.com>
Sun, 28 Sep 2014 14:30:55 +0000 (18:30 +0400)
119 files changed:
cds/container/basket_queue.h
cds/container/cuckoo_map.h
cds/container/cuckoo_set.h
cds/container/details/make_split_list_set.h
cds/container/ellen_bintree_map_rcu.h
cds/container/ellen_bintree_set_rcu.h
cds/container/impl/ellen_bintree_map.h
cds/container/impl/ellen_bintree_set.h
cds/container/impl/lazy_kvlist.h
cds/container/impl/lazy_list.h
cds/container/impl/michael_kvlist.h
cds/container/impl/michael_list.h
cds/container/impl/skip_list_map.h
cds/container/impl/skip_list_set.h
cds/container/lazy_kvlist_nogc.h
cds/container/lazy_kvlist_rcu.h
cds/container/lazy_list_rcu.h
cds/container/michael_kvlist_nogc.h
cds/container/michael_kvlist_rcu.h
cds/container/michael_list_rcu.h
cds/container/michael_map.h
cds/container/michael_map_nogc.h
cds/container/michael_map_rcu.h
cds/container/michael_set.h
cds/container/michael_set_rcu.h
cds/container/moir_queue.h
cds/container/mspriority_queue.h
cds/container/msqueue.h
cds/container/optimistic_queue.h
cds/container/rwqueue.h
cds/container/segmented_queue.h
cds/container/skip_list_map_nogc.h
cds/container/skip_list_map_rcu.h
cds/container/skip_list_set_rcu.h
cds/container/split_list_map.h
cds/container/split_list_map_nogc.h
cds/container/split_list_map_rcu.h
cds/container/split_list_set.h
cds/container/split_list_set_rcu.h
cds/container/striped_map.h
cds/container/striped_map/boost_list.h
cds/container/striped_map/boost_slist.h
cds/container/striped_map/std_hash_map_std.h
cds/container/striped_map/std_hash_map_vc.h
cds/container/striped_map/std_list.h
cds/container/striped_map/std_map.h
cds/container/striped_set.h
cds/container/striped_set/adapter.h
cds/container/striped_set/boost_list.h
cds/container/striped_set/boost_slist.h
cds/container/striped_set/boost_stable_vector.h
cds/container/striped_set/boost_vector.h
cds/container/striped_set/std_hash_set_std.h
cds/container/striped_set/std_hash_set_vc.h
cds/container/striped_set/std_list.h
cds/container/striped_set/std_set.h
cds/container/striped_set/std_vector.h
cds/container/tsigas_cycle_queue.h
cds/container/vyukov_mpmc_cycle_queue.h
cds/details/functor_wrapper.h
cds/intrusive/basket_queue.h
cds/intrusive/cuckoo_set.h
cds/intrusive/details/lazy_list_base.h
cds/intrusive/details/michael_list_base.h
cds/intrusive/details/michael_set_base.h
cds/intrusive/ellen_bintree_rcu.h
cds/intrusive/impl/ellen_bintree.h
cds/intrusive/impl/lazy_list.h
cds/intrusive/impl/michael_list.h
cds/intrusive/impl/skip_list.h
cds/intrusive/lazy_list_nogc.h
cds/intrusive/lazy_list_rcu.h
cds/intrusive/michael_list_nogc.h
cds/intrusive/michael_list_rcu.h
cds/intrusive/michael_set.h
cds/intrusive/michael_set_nogc.h
cds/intrusive/michael_set_rcu.h
cds/intrusive/mspriority_queue.h
cds/intrusive/optimistic_queue.h
cds/intrusive/skip_list_nogc.h
cds/intrusive/skip_list_rcu.h
cds/intrusive/split_list.h
cds/intrusive/split_list_nogc.h
cds/intrusive/split_list_rcu.h
cds/intrusive/striped_set.h
cds/intrusive/striped_set/adapter.h
cds/intrusive/striped_set/boost_list.h
cds/intrusive/striped_set/boost_slist.h
cds/intrusive/striped_set/boost_unordered_set.h
cds/intrusive/treiber_stack.h
cds/intrusive/tsigas_cycle_queue.h
cds/intrusive/vyukov_mpmc_cycle_queue.h
cds/ref.h [deleted file]
tests/test-hdr/map/hdr_cuckoo_map.h
tests/test-hdr/map/hdr_map.h
tests/test-hdr/map/hdr_striped_map.h
tests/test-hdr/ordered_list/hdr_lazy.h
tests/test-hdr/ordered_list/hdr_lazy_kv.h
tests/test-hdr/ordered_list/hdr_michael.h
tests/test-hdr/ordered_list/hdr_michael_kv.h
tests/test-hdr/priority_queue/hdr_intrusive_pqueue.h
tests/test-hdr/priority_queue/hdr_pqueue.h
tests/test-hdr/queue/hdr_segmented_queue.h
tests/test-hdr/set/hdr_cuckoo_set.h
tests/test-hdr/set/hdr_intrusive_set.h
tests/test-hdr/set/hdr_intrusive_skiplist_set.h
tests/test-hdr/set/hdr_set.h
tests/test-hdr/set/hdr_striped_set.h
tests/test-hdr/tree/hdr_ellenbintree_map.h
tests/test-hdr/tree/hdr_ellenbintree_set.h
tests/unit/map2/map_insdel_func.cpp
tests/unit/map2/std_hash_map_gcc.h
tests/unit/map2/std_hash_map_vc.h
tests/unit/map2/std_map_gcc.h
tests/unit/map2/std_map_vc.h
tests/unit/set2/set_insdel_func.h
tests/unit/set2/std_hash_set_std.h
tests/unit/set2/std_hash_set_vc9.h
tests/unit/set2/std_set.h

index 2c67bca332022ac6125725c47b048fba3d68fdfa..db3604a8ef55777ee6e5d16f34a3e480c570a143 100644 (file)
@@ -4,12 +4,11 @@
 #define __CDS_CONTAINER_BASKET_QUEUE_H
 
 #include <memory>
+#include <functional>   // ref
 #include <cds/intrusive/basket_queue.h>
 #include <cds/container/details/base.h>
-#include <cds/ref.h>
 #include <cds/details/trivial_assign.h>
 
-
 namespace cds { namespace container {
 
     //@cond
@@ -268,7 +267,7 @@ namespace cds { namespace container {
         bool enqueue( const Type& data, Func f  )
         {
             scoped_node_ptr p( alloc_node());
-            cds::unref(f)( p->m_value, data );
+            f( p->m_value, data );
             if ( base_class::enqueue( *p )) {
                 p.release();
                 return true;
@@ -311,7 +310,7 @@ namespace cds { namespace container {
         {
             typename base_class::dequeue_result res;
             if ( base_class::do_dequeue( res, true )) {
-                cds::unref(f)( dest, node_traits::to_value_ptr( *res.pNext )->m_value );
+                f( dest, node_traits::to_value_ptr( *res.pNext )->m_value );
                 return true;
             }
             return false;
index 7cffae9bfc54f23f5ff31d21647f9c72b0185d1a..a6043b0a21b5c1904907fdd8b7a65fe555b43f7c 100644 (file)
@@ -507,7 +507,7 @@ namespace cds { namespace container {
                 - <tt>item.first</tt> is a const reference to item's key that cannot be changed.
                 - <tt>item.second</tt> is a reference to item's value that may be changed.
 
-            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.
@@ -524,7 +524,7 @@ namespace cds { namespace container {
         bool insert_key( const K& key, Func func )
         {
             scoped_node_ptr pNode( alloc_node( key ));
-            if ( base_class::insert( *pNode, [&func]( node_type& item ) { cds::unref(func)( item.m_val ); } )) {
+            if ( base_class::insert( *pNode, [&func]( node_type& item ) { func( item.m_val ); } )) {
                 pNode.release();
                 return true;
             }
@@ -571,7 +571,7 @@ namespace cds { namespace container {
 
             The functor may change any fields of the \p item.second that is \ref value_type.
 
-            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
 
             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
@@ -582,7 +582,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( key ));
             std::pair<bool, bool> res = base_class::ensure( *pNode,
-                [&func](bool bNew, node_type& item, node_type const& ){ cds::unref(func)( bNew, item.m_val ); }
+                [&func](bool bNew, node_type& item, node_type const& ){ func( bNew, item.m_val ); }
             );
             if ( res.first && res.second )
                 pNode.release();
@@ -647,7 +647,7 @@ namespace cds { namespace container {
         {
             node_type * pNode = base_class::erase( key );
             if ( pNode ) {
-                cds::unref(f)( pNode->m_val );
+                f( pNode->m_val );
                 free_node( pNode );
                 return true;
             }
@@ -667,7 +667,7 @@ namespace cds { namespace container {
         {
             node_type * pNode = base_class::erase_with( key, cds::details::predicate_wrapper<node_type, Predicate, key_accessor>() );
             if ( pNode ) {
-                cds::unref(f)( pNode->m_val );
+                f( pNode->m_val );
                 free_node( pNode );
                 return true;
             }
@@ -686,7 +686,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found.
 
-            You can pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by reference using \p std::ref
 
             The functor may change \p item.second.
 
@@ -695,7 +695,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-            return base_class::find( key, [&f](node_type& item, K const& ) { cds::unref(f)( item.m_val );});
+            return base_class::find( key, [&f](node_type& item, K const& ) { f( item.m_val );});
         }
 
         /// Find the key \p val using \p pred predicate for comparing
@@ -710,7 +710,7 @@ namespace cds { namespace container {
         bool find_with( K const& key, Predicate pred, Func f )
         {
             return base_class::find_with( key, cds::details::predicate_wrapper<node_type, Predicate, key_accessor>(),
-                [&f](node_type& item, K const& ) { cds::unref(f)( item.m_val );});
+                [&f](node_type& item, K const& ) { f( item.m_val );});
         }
 
         /// Find the key \p key
index 5f2bf3ef3c8699d1fc736216f0344a51bd17219a..605f2a43e6c656a77ba62edc8af3610aa94c3edb 100644 (file)
@@ -537,13 +537,13 @@ namespace cds { namespace container {
             Therefore, the \p value_type should be constructible from type \p Q.
 
             The user-defined functor is called only if the inserting is success. It can be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref
         */
         template <typename Q, typename Func>
         bool insert( Q const& val, Func f )
         {
             scoped_node_ptr pNode( alloc_node( val ));
-            if ( base_class::insert( *pNode, [&f]( node_type& node ) { cds::unref(f)( node.m_val ); } )) {
+            if ( base_class::insert( *pNode, [&f]( node_type& node ) { f( node.m_val ); } )) {
                 pNode.release();
                 return true;
             }
@@ -589,7 +589,7 @@ namespace cds { namespace container {
 
             The functor can change non-key fields of the \p item.
 
-            You can pass \p func argument by value or by reference using <tt>boost::ref</tt>.
+            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 val key
@@ -600,7 +600,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( val ));
             std::pair<bool, bool> res = base_class::ensure( *pNode,
-                [&val,&func](bool bNew, node_type& item, node_type const& ){ cds::unref(func)( bNew, item.m_val, val ); }
+                [&val,&func](bool bNew, node_type& item, node_type const& ){ func( bNew, item.m_val, val ); }
             );
             if ( res.first && res.second )
                 pNode.release();
@@ -668,7 +668,7 @@ namespace cds { namespace container {
         {
             node_type * pNode = base_class::erase( key );
             if ( pNode ) {
-                cds::unref(f)( pNode->m_val );
+                f( pNode->m_val );
                 free_node( pNode );
                 return true;
             }
@@ -688,7 +688,7 @@ namespace cds { namespace container {
         {
             node_type * pNode = base_class::erase_with( key, typename maker::template predicate_wrapper<Predicate, bool>() );
             if ( pNode ) {
-                cds::unref(f)( pNode->m_val );
+                f( pNode->m_val );
                 free_node( pNode );
                 return true;
             }
@@ -707,7 +707,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref
 
             The functor can change non-key fields of \p item.
             The \p val argument is non-const since it can be used as \p f functor destination i.e., the functor
@@ -721,7 +721,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q& val, Func f )
         {
-            return base_class::find( val, [&f](node_type& item, Q& v) { cds::unref(f)( item.m_val, v );});
+            return base_class::find( val, [&f](node_type& item, Q& v) { f( item.m_val, v );});
         }
 
         /// Find the key \p val using \p pred predicate for comparing
@@ -736,7 +736,7 @@ namespace cds { namespace container {
         bool find_with( Q& val, Predicate pred, Func f )
         {
             return base_class::find_with( val, typename maker::template predicate_wrapper<Predicate, bool>(),
-                [&f](node_type& item, Q& v) { cds::unref(f)( item.m_val, v );});
+                [&f](node_type& item, Q& v) { f( item.m_val, v );});
         }
 
         /// Find the key \p val
@@ -751,7 +751,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref
 
             The functor can change non-key fields of \p item.
 
@@ -763,7 +763,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q const& val, Func f )
         {
-            return base_class::find( val, [&f](node_type& item, Q const& v) { cds::unref(f)( item.m_val, v );});
+            return base_class::find( val, [&f](node_type& item, Q const& v) { f( item.m_val, v );});
         }
 
         /// Find the key \p val using \p pred predicate for comparing
@@ -778,7 +778,7 @@ namespace cds { namespace container {
         bool find_with( Q const& val, Predicate pred, Func f )
         {
             return base_class::find_with( val, typename maker::template predicate_wrapper<Predicate, bool>(),
-                [&f](node_type& item, Q const& v) { cds::unref(f)( item.m_val, v );});
+                [&f](node_type& item, Q const& v) { f( item.m_val, v );});
         }
 
         /// Find the key \p val
index 630f821f08b5bb35df6b13bda8fe80d7e0ab601d..fce37e08d6fa9ae87ee613bd5d711c2f52d2c115 100644 (file)
@@ -16,7 +16,7 @@ namespace cds { namespace container {
 
     namespace details {
 
-#ifdef __CDS_CONTAINER_MICHAEL_LIST_BASE_H
+#ifdef __CDS_CONTAINER_DETAILS_MICHAEL_LIST_BASE_H
         // if michael_list included
 
         template <typename GC, typename T, typename Traits>
@@ -117,9 +117,9 @@ namespace cds { namespace container {
             typedef cds::intrusive::MichaelList< gc, node_type, ordered_list_traits >   ordered_list;
             typedef cds::intrusive::SplitListSet< gc, ordered_list, type_traits >       type;
         };
-#endif  // ifdef __CDS_CONTAINER_MICHAEL_LIST_BASE_H
+#endif  // ifdef __CDS_CONTAINER_DETAILS_MICHAEL_LIST_BASE_H
 
-#ifdef __CDS_CONTAINER_LAZY_LIST_BASE_H
+#ifdef __CDS_CONTAINER_DETAILS_LAZY_LIST_BASE_H
         // if lazy_list included
         template <typename GC, typename T, typename Traits>
         struct make_split_list_set< GC, T, lazy_list_tag, Traits >
@@ -226,7 +226,7 @@ namespace cds { namespace container {
             typedef cds::intrusive::LazyList< gc, node_type, ordered_list_traits >  ordered_list;
             typedef cds::intrusive::SplitListSet< gc, ordered_list, type_traits >   type;
         };
-#endif  // ifdef __CDS_CONTAINER_LAZY_LIST_BASE_H
+#endif  // ifdef __CDS_CONTAINER_DETAILS_LAZY_LIST_BASE_H
 
     }   // namespace details
 }}  // namespace cds::container
index 3da5594285604aa7640004b321bdefea2d32273b..3ac34c433f083e9abd7e3a78e466f6eb730954f6 100644 (file)
@@ -213,7 +213,7 @@ namespace cds { namespace container {
                 - <tt>item.first</tt> is a const reference to item's key that cannot be changed.
                 - <tt>item.second</tt> is a reference to item's value that may be changed.
 
-            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.
@@ -232,7 +232,7 @@ namespace cds { namespace container {
         bool insert_key( const K& key, Func func )
         {
             scoped_node_ptr pNode( cxx_leaf_node_allocator().New( key ));
-            if ( base_class::insert( *pNode, [&func]( leaf_node& item ) { cds::unref(func)( item.m_Value ); } )) {
+            if ( base_class::insert( *pNode, [&func]( leaf_node& item ) { func( item.m_Value ); } )) {
                 pNode.release();
                 return true;
             }
@@ -281,7 +281,7 @@ namespace cds { namespace container {
 
             The functor may change any fields of the \p item.second that is \ref value_type.
 
-            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
 
             RCU \p synchronize method can be called. RCU should not be locked.
 
@@ -294,7 +294,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( cxx_leaf_node_allocator().New( key ));
             std::pair<bool, bool> res = base_class::ensure( *pNode,
-                [&func](bool bNew, leaf_node& item, leaf_node const& ){ cds::unref(func)( bNew, item.m_Value ); }
+                [&func](bool bNew, leaf_node& item, leaf_node const& ){ func( bNew, item.m_Value ); }
             );
             if ( res.first && res.second )
                 pNode.release();
@@ -348,7 +348,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool erase( K const& key, Func f )
         {
-            return base_class::erase( key, [&f]( leaf_node& node) { cds::unref(f)( node.m_Value ); } );
+            return base_class::erase( key, [&f]( leaf_node& node) { f( node.m_Value ); } );
         }
 
         /// Deletes the item from the map using \p pred predicate for searching
@@ -362,7 +362,7 @@ namespace cds { namespace container {
         bool erase_with( K const& key, Less pred, Func f )
         {
             return base_class::erase_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >(),
-                [&f]( leaf_node& node) { cds::unref(f)( node.m_Value ); } );
+                [&f]( leaf_node& node) { f( node.m_Value ); } );
         }
 
         /// Extracts an item with minimal key from the map
@@ -452,7 +452,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found.
 
-            You can pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by reference using \p std::ref
 
             The functor may change \p item.second.
 
@@ -463,7 +463,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-            return base_class::find( key, [&f](leaf_node& item, K const& ) { cds::unref(f)( item.m_Value );});
+            return base_class::find( key, [&f](leaf_node& item, K const& ) { f( item.m_Value );});
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -477,7 +477,7 @@ namespace cds { namespace container {
         bool find_with( K const& key, Less pred, Func f )
         {
             return base_class::find_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >(),
-                [&f](leaf_node& item, K const& ) { cds::unref(f)( item.m_Value );});
+                [&f](leaf_node& item, K const& ) { f( item.m_Value );});
         }
 
         /// Find the key \p key
index 96788e52c09df3eacd862d2c2058bd4e7c01fb9e..405acc9ec8fea9f11201e0fbfae63737d47e6afe 100644 (file)
@@ -224,7 +224,7 @@ namespace cds { namespace container {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
             The user-defined functor is called only if the inserting is success. It may be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref
 
             RCU \p synchronize method can be called. RCU should not be locked.
         */
@@ -232,7 +232,7 @@ namespace cds { namespace container {
         bool insert( Q const& val, Func f )
         {
             scoped_node_ptr sp( cxx_leaf_node_allocator().New( val ));
-            if ( base_class::insert( *sp.get(), [&f]( leaf_node& val ) { cds::unref(f)( val.m_Value ); } )) {
+            if ( base_class::insert( *sp.get(), [&f]( leaf_node& val ) { f( val.m_Value ); } )) {
                 sp.release();
                 return true;
             }
@@ -264,7 +264,7 @@ namespace cds { namespace container {
             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 may pass \p func argument by reference using <tt>boost::ref</tt>.
+            You may pass \p func argument by reference using \p std::ref
 
             RCU \p synchronize method can be called. RCU should not be locked.
 
@@ -277,7 +277,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr sp( cxx_leaf_node_allocator().New( val ));
             std::pair<bool, bool> bRes = base_class::ensure( *sp,
-                [&func, &val](bool bNew, leaf_node& node, leaf_node&){ cds::unref(func)( bNew, node.m_Value, val ); });
+                [&func, &val](bool bNew, leaf_node& node, leaf_node&){ func( bNew, node.m_Value, val ); });
             if ( bRes.first && bRes.second )
                 sp.release();
             return bRes;
@@ -357,7 +357,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool erase( Q const& key, Func f )
         {
-            return base_class::erase( key, [&f]( leaf_node const& node) { cds::unref(f)( node.m_Value ); } );
+            return base_class::erase( key, [&f]( leaf_node const& node) { f( node.m_Value ); } );
         }
 
         /// Deletes the item from the set using \p pred predicate for searching
@@ -371,7 +371,7 @@ namespace cds { namespace container {
         bool erase_with( Q const& key, Less pred, Func f )
         {
             return base_class::erase_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
-                [&f]( leaf_node const& node) { cds::unref(f)( node.m_Value ); } );
+                [&f]( leaf_node const& node) { f( node.m_Value ); } );
         }
 
         /// Extracts an item with minimal key from the set
@@ -462,7 +462,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -482,7 +482,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q& val, Func f ) const
         {
-            return base_class::find( val, [&f]( leaf_node& node, Q& v ) { cds::unref(f)( node.m_Value, v ); });
+            return base_class::find( val, [&f]( leaf_node& node, Q& v ) { f( node.m_Value, v ); });
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -496,7 +496,7 @@ namespace cds { namespace container {
         bool find_with( Q& val, Less pred, Func f ) const
         {
             return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
-                [&f]( leaf_node& node, Q& v ) { cds::unref(f)( node.m_Value, v ); } );
+                [&f]( leaf_node& node, Q& v ) { f( node.m_Value, v ); } );
         }
 
         /// Find the key \p val
@@ -511,7 +511,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -528,7 +528,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q const& val, Func f ) const
         {
-            return base_class::find( val, [&f]( leaf_node& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); });
+            return base_class::find( val, [&f]( leaf_node& node, Q const& v ) { f( node.m_Value, v ); });
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -542,7 +542,7 @@ namespace cds { namespace container {
         bool find_with( Q const& val, Less pred, Func f ) const
         {
             return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
-                [&f]( leaf_node& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); } );
+                [&f]( leaf_node& node, Q const& v ) { f( node.m_Value, v ); } );
         }
 
         /// Find the key \p val
index 028f5d65e98029bb15ec0c215ea0fca644f55901..e3e35ce18bdb7f5dcd869d55f85748b9ac4ef4ee 100644 (file)
@@ -210,7 +210,7 @@ namespace cds { namespace container {
                 - <tt>item.first</tt> is a const reference to item's key that cannot be changed.
                 - <tt>item.second</tt> is a reference to item's value that may be changed.
 
-            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.
@@ -227,7 +227,7 @@ namespace cds { namespace container {
         bool insert_key( const K& key, Func func )
         {
             scoped_node_ptr pNode( cxx_leaf_node_allocator().New( key ));
-            if ( base_class::insert( *pNode, [&func]( leaf_node& item ) { cds::unref(func)( item.m_Value ); } )) {
+            if ( base_class::insert( *pNode, [&func]( leaf_node& item ) { func( item.m_Value ); } )) {
                 pNode.release();
                 return true;
             }
@@ -274,7 +274,7 @@ namespace cds { namespace container {
 
             The functor may change any fields of the \p item.second that is \ref value_type.
 
-            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.
 
             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
@@ -285,7 +285,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( cxx_leaf_node_allocator().New( key ));
             std::pair<bool, bool> res = base_class::ensure( *pNode,
-                [&func](bool bNew, leaf_node& item, leaf_node const& ){ cds::unref(func)( bNew, item.m_Value ); }
+                [&func](bool bNew, leaf_node& item, leaf_node const& ){ func( bNew, item.m_Value ); }
             );
             if ( res.first && res.second )
                 pNode.release();
@@ -335,7 +335,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool erase( K const& key, Func f )
         {
-            return base_class::erase( key, [&f]( leaf_node& node) { cds::unref(f)( node.m_Value ); } );
+            return base_class::erase( key, [&f]( leaf_node& node) { f( node.m_Value ); } );
         }
 
         /// Deletes the item from the map using \p pred predicate for searching
@@ -349,7 +349,7 @@ namespace cds { namespace container {
         bool erase_with( K const& key, Less pred, Func f )
         {
             return base_class::erase_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >(),
-                [&f]( leaf_node& node) { cds::unref(f)( node.m_Value ); } );
+                [&f]( leaf_node& node) { f( node.m_Value ); } );
         }
 
         /// Extracts an item with minimal key from the map
@@ -432,7 +432,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found.
 
-            You can pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by reference using std::ref.
 
             The functor may change \p item.second.
 
@@ -441,7 +441,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-            return base_class::find( key, [&f](leaf_node& item, K const& ) { cds::unref(f)( item.m_Value );});
+            return base_class::find( key, [&f](leaf_node& item, K const& ) { f( item.m_Value );});
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -455,7 +455,7 @@ namespace cds { namespace container {
         bool find_with( K const& key, Less pred, Func f )
         {
             return base_class::find_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::key_accessor >(),
-                [&f](leaf_node& item, K const& ) { cds::unref(f)( item.m_Value );});
+                [&f](leaf_node& item, K const& ) { f( item.m_Value );});
         }
 
         /// Find the key \p key
index e47739db95a61ea85687cdb9a70b9d92a1ad4774..632b2b780c2f7aade66f19fe8ebef5508552ea47 100644 (file)
@@ -223,13 +223,13 @@ namespace cds { namespace container {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
             The user-defined functor is called only if the inserting is success. It may be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref
         */
         template <typename Q, typename Func>
         bool insert( Q const& val, Func f )
         {
             scoped_node_ptr sp( cxx_leaf_node_allocator().New( val ));
-            if ( base_class::insert( *sp.get(), [&f]( leaf_node& val ) { cds::unref(f)( val.m_Value ); } )) {
+            if ( base_class::insert( *sp.get(), [&f]( leaf_node& val ) { f( val.m_Value ); } )) {
                 sp.release();
                 return true;
             }
@@ -261,7 +261,7 @@ namespace cds { namespace container {
             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 may pass \p func argument by reference using <tt>boost::ref</tt>.
+            You may pass \p func argument 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
@@ -272,7 +272,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr sp( cxx_leaf_node_allocator().New( val ));
             std::pair<bool, bool> bRes = base_class::ensure( *sp,
-                [&func, &val](bool bNew, leaf_node& node, leaf_node&){ cds::unref(func)( bNew, node.m_Value, val ); });
+                [&func, &val](bool bNew, leaf_node& node, leaf_node&){ func( bNew, node.m_Value, val ); });
             if ( bRes.first && bRes.second )
                 sp.release();
             return bRes;
@@ -344,7 +344,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool erase( Q const& key, Func f )
         {
-            return base_class::erase( key, [&f]( leaf_node const& node) { cds::unref(f)( node.m_Value ); } );
+            return base_class::erase( key, [&f]( leaf_node const& node) { f( node.m_Value ); } );
         }
 
         /// Deletes the item from the set using \p pred predicate for searching
@@ -358,7 +358,7 @@ namespace cds { namespace container {
         bool erase_with( Q const& key, Less pred, Func f )
         {
             return base_class::erase_with( key, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
-                [&f]( leaf_node const& node) { cds::unref(f)( node.m_Value ); } );
+                [&f]( leaf_node const& node) { f( node.m_Value ); } );
         }
 
         /// Extracts an item with minimal key from the set
@@ -442,7 +442,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -460,7 +460,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q& val, Func f )
         {
-            return base_class::find( val, [&f]( leaf_node& node, Q& v ) { cds::unref(f)( node.m_Value, v ); });
+            return base_class::find( val, [&f]( leaf_node& node, Q& v ) { f( node.m_Value, v ); });
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -474,7 +474,7 @@ namespace cds { namespace container {
         bool find_with( Q& val, Less pred, Func f )
         {
             return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
-                [&f]( leaf_node& node, Q& v ) { cds::unref(f)( node.m_Value, v ); } );
+                [&f]( leaf_node& node, Q& v ) { f( node.m_Value, v ); } );
         }
 
         /// Find the key \p val
@@ -489,7 +489,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -504,7 +504,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q const& val, Func f )
         {
-            return base_class::find( val, [&f]( leaf_node& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); });
+            return base_class::find( val, [&f]( leaf_node& node, Q const& v ) { f( node.m_Value, v ); });
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -518,7 +518,7 @@ namespace cds { namespace container {
         bool find_with( Q const& val, Less pred, Func f )
         {
             return base_class::find_with( val, cds::details::predicate_wrapper< leaf_node, Less, typename maker::value_accessor >(),
-                [&f]( leaf_node& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); } );
+                [&f]( leaf_node& node, Q const& v ) { f( node.m_Value, v ); } );
         }
 
         /// Find the key \p val
index f4265bde68024d3d93b51ddab1e2b5f76a583492..3fc36447e97252f1b6cb79e194225f5dd172cfe6 100644 (file)
@@ -4,7 +4,7 @@
 #define __CDS_CONTAINER_IMPL_LAZY_KVLIST_H
 
 #include <memory>
-#include <cds/ref.h>
+#include <functional>   // ref
 #include <cds/details/functor_wrapper.h>
 #include <cds/container/details/guarded_ptr_cast.h>
 
@@ -417,7 +417,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.
@@ -473,7 +473,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.
 
             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
@@ -624,7 +624,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.
@@ -760,7 +760,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;
             }
@@ -782,7 +782,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 Compare>
@@ -797,7 +797,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();
 
@@ -813,7 +813,7 @@ namespace cds { namespace container {
         template <typename K, typename Compare, typename Func>
         bool find_at( head_type& refHead, K& key, Compare cmp, Func f )
         {
-            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>
index 57777ddd9741b8169e26a4ae849bee7ac81c97b3..783e08d7665f06acf8b7bdf12fc4defc7c3f0c1c 100644 (file)
@@ -376,7 +376,7 @@ namespace cds { namespace container {
             The argument \p itemValue of user-defined functor \p func is the reference
             to the list's item inserted. 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 the inserting is success.
 
             The type \p Q should contain the complete key of the node.
@@ -431,7 +431,7 @@ namespace cds { namespace container {
             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 may pass \p func argument by reference using <tt>boost::ref</tt>.
+            You may pass \p func argument 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
@@ -593,7 +593,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the function is only guarantee
             that \p item cannot be deleted during functor is executing.
@@ -635,7 +635,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 function does not serialize simultaneous access to the list \p item. If such access is
             possible you must provide your own synchronization schema to exclude unsafe item modifications.
@@ -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_to_value(node) ); } )) {
+            if ( base_class::insert_at( &refHead, *pNode, [&f](node_type& node){ f( node_to_value(node) ); } )) {
                 pNode.release();
                 return true;
             }
@@ -779,7 +779,7 @@ namespace cds { namespace container {
         template <typename Q, typename Compare, typename Func>
         bool erase_at( head_type& refHead, const Q& key, Compare cmp, Func f )
         {
-            return base_class::erase_at( &refHead, key, cmp, [&f](node_type const& node){ cds::unref(f)( node_to_value(node) ); } );
+            return base_class::erase_at( &refHead, key, cmp, [&f](node_type const& node){ f( node_to_value(node) ); } );
         }
 
         template <typename Q, typename Compare>
@@ -794,7 +794,7 @@ namespace cds { namespace container {
             scoped_node_ptr pNode( alloc_node( key ));
 
             std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode,
-                [&f, &key](bool bNew, node_type& node, node_type&){cds::unref(f)( bNew, node_to_value(node), key ); });
+                [&f, &key](bool bNew, node_type& node, node_type&){f( bNew, node_to_value(node), key ); });
             if ( ret.first && ret.second )
                 pNode.release();
 
@@ -810,7 +810,7 @@ namespace cds { namespace container {
         template <typename Q, typename Compare, typename Func>
         bool find_at( head_type& refHead, Q& val, Compare cmp, Func f )
         {
-            return base_class::find_at( &refHead, val, cmp, [&f](node_type& node, Q& val){ cds::unref(f)( node_to_value(node), val ); });
+            return base_class::find_at( &refHead, val, cmp, [&f](node_type& node, Q& val){ f( node_to_value(node), val ); });
         }
 
         template <typename Q, typename Compare>
index d9dffc90da3ce58964f6f5eef8ade772e2851c3f..cd50086f76b8ea0ae4752390ed0f1fb40dea4834 100644 (file)
@@ -4,7 +4,7 @@
 #define __CDS_CONTAINER_IMPL_MICHAEL_KVLIST_H
 
 #include <memory>
-#include <cds/ref.h>
+#include <functional>   // ref
 #include <cds/details/functor_wrapper.h>
 #include <cds/container/details/guarded_ptr_cast.h>
 
@@ -396,7 +396,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.
@@ -442,7 +442,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
 
             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
@@ -608,7 +608,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.
@@ -745,7 +745,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;
             }
@@ -764,7 +764,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();
 
@@ -780,7 +780,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 Compare>
         bool extract_at( head_type& refHead, typename gc::Guard& dest, K const& key, Compare cmp )
@@ -797,7 +797,7 @@ namespace cds { namespace container {
         template <typename K, typename Compare, typename Func>
         bool find_at( head_type& refHead, K& key, Compare cmp, Func f )
         {
-            return base_class::find_at( refHead, key, cmp, [&f](node_type& node, K const&){ cds::unref(f)( node.m_Data ); });
+            return base_class::find_at( refHead, key, cmp, [&f](node_type& node, K const&){ f( node.m_Data ); });
         }
 
         template <typename K, typename Compare>
index 4bbf019382de6b479e0158bca50e1e09ce16b3fd..7ef71ec7e4d9b7ecb9f0aabdb6ab8678dcdaf254 100644 (file)
@@ -347,7 +347,7 @@ namespace cds { namespace container {
             The argument \p itemValue of user-defined functor \p func is the reference
             to the list's item inserted. 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 the inserting is success.
 
             The type \p Q should contain the complete key of the node.
@@ -392,7 +392,7 @@ namespace cds { namespace container {
             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 may pass \p func argument by reference using <tt>boost::ref</tt>.
+            You may pass \p func argument by reference by \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
@@ -564,7 +564,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the function is only guarantee
             that \p item cannot be deleted during functor is executing.
@@ -606,7 +606,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the function is only guarantee
             that \p item cannot be deleted during functor is executing.
@@ -735,7 +735,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_to_value(node) ); } )) {
+            if ( base_class::insert_at( refHead, *pNode, [&f]( node_type& node ) { f( node_to_value(node) ); } )) {
                 pNode.release();
                 return true;
             }
@@ -751,7 +751,7 @@ namespace cds { namespace container {
         template <typename Q, typename Compare, typename Func>
         bool erase_at( head_type& refHead, Q const& key, Compare cmp, Func f )
         {
-            return base_class::erase_at( refHead, key, cmp, [&f](node_type const& node){ cds::unref(f)( node_to_value(node) ); } );
+            return base_class::erase_at( refHead, key, cmp, [&f](node_type const& node){ f( node_to_value(node) ); } );
         }
 
         template <typename Q, typename Compare>
@@ -766,7 +766,7 @@ namespace cds { namespace container {
             scoped_node_ptr pNode( alloc_node( key ));
 
             std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode,
-                [&f, &key](bool bNew, node_type& node, node_type&){ cds::unref(f)( bNew, node_to_value(node), key ); });
+                [&f, &key](bool bNew, node_type& node, node_type&){ f( bNew, node_to_value(node), key ); });
             if ( ret.first && ret.second )
                 pNode.release();
 
@@ -782,7 +782,7 @@ namespace cds { namespace container {
         template <typename Q, typename Compare, typename Func>
         bool find_at( head_type& refHead, Q& val, Compare cmp, Func f )
         {
-            return base_class::find_at( refHead, val, cmp, [&f](node_type& node, Q& v){ cds::unref(f)( node_to_value(node), v ); });
+            return base_class::find_at( refHead, val, cmp, [&f](node_type& node, Q& v){ f( node_to_value(node), v ); });
         }
 
         template <typename Q, typename Compare>
index dd5e7851b0806198d07c5eb03eeacfd74de10981..6ad9a185c37b58195fdde370e08e2bc64a8f50bc 100644 (file)
@@ -274,7 +274,7 @@ namespace cds { namespace container {
                 - <tt>item.first</tt> is a const reference to item's key that cannot be changed.
                 - <tt>item.second</tt> is a reference to item's value that may be changed.
 
-            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.
@@ -291,7 +291,7 @@ namespace cds { namespace container {
         bool insert_key( const K& key, Func func )
         {
             scoped_node_ptr pNode( node_allocator().New( random_level(), key ));
-            if ( base_class::insert( *pNode, [&func]( node_type& item ) { cds::unref(func)( item.m_Value ); } )) {
+            if ( base_class::insert( *pNode, [&func]( node_type& item ) { func( item.m_Value ); } )) {
                 pNode.release();
                 return true;
             }
@@ -338,7 +338,7 @@ namespace cds { namespace container {
 
             The functor may change any fields of the \p item.second that is \ref value_type.
 
-            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
 
             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
@@ -349,7 +349,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( node_allocator().New( random_level(), key ));
             std::pair<bool, bool> res = base_class::ensure( *pNode,
-                [&func](bool bNew, node_type& item, node_type const& ){ cds::unref(func)( bNew, item.m_Value ); }
+                [&func](bool bNew, node_type& item, node_type const& ){ func( bNew, item.m_Value ); }
             );
             if ( res.first && res.second )
                 pNode.release();
@@ -399,7 +399,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool erase( K const& key, Func f )
         {
-            return base_class::erase( key, [&f]( node_type& node) { cds::unref(f)( node.m_Value ); } );
+            return base_class::erase( key, [&f]( node_type& node) { f( node.m_Value ); } );
         }
 
         /// Deletes the item from the map using \p pred predicate for searching
@@ -414,7 +414,7 @@ namespace cds { namespace container {
         {
             return base_class::erase_with( key,
                 cds::details::predicate_wrapper< node_type, Less, typename maker::key_accessor >(),
-                [&f]( node_type& node) { cds::unref(f)( node.m_Value ); } );
+                [&f]( node_type& node) { f( node.m_Value ); } );
         }
 
         /// Extracts the item from the map with specified \p key
@@ -536,7 +536,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found.
 
-            You can pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by reference using \p std::ref
 
             The functor may change \p item.second.
 
@@ -545,7 +545,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-            return base_class::find( key, [&f](node_type& item, K const& ) { cds::unref(f)( item.m_Value );});
+            return base_class::find( key, [&f](node_type& item, K const& ) { f( item.m_Value );});
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -560,7 +560,7 @@ namespace cds { namespace container {
         {
             return base_class::find_with( key,
                 cds::details::predicate_wrapper< node_type, Less, typename maker::key_accessor >(),
-                [&f](node_type& item, K const& ) { cds::unref(f)( item.m_Value );});
+                [&f](node_type& item, K const& ) { f( item.m_Value );});
         }
 
         /// Find the key \p key
index f4a89c95a1456a6daa26db40c9fe97a4cf0a2789..783bc86222aa6a7765cb51b6cb19f39eb629da58 100644 (file)
@@ -250,13 +250,13 @@ namespace cds { namespace container {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
             The user-defined functor is called only if the inserting is success. It may be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref
         */
         template <typename Q, typename Func>
         bool insert( Q const& val, Func f )
         {
             scoped_node_ptr sp( node_allocator().New( random_level(), val ));
-            if ( base_class::insert( *sp.get(), [&f]( node_type& val ) { cds::unref(f)( val.m_Value ); } )) {
+            if ( base_class::insert( *sp.get(), [&f]( node_type& val ) { f( val.m_Value ); } )) {
                 sp.release();
                 return true;
             }
@@ -288,7 +288,7 @@ namespace cds { namespace container {
             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 may pass \p func argument by reference using <tt>boost::ref</tt>.
+            You may pass \p func argument 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
@@ -299,7 +299,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr sp( node_allocator().New( random_level(), val ));
             std::pair<bool, bool> bRes = base_class::ensure( *sp,
-                [&func, &val](bool bNew, node_type& node, node_type&){ cds::unref(func)( bNew, node.m_Value, val ); });
+                [&func, &val](bool bNew, node_type& node, node_type&){ func( bNew, node.m_Value, val ); });
             if ( bRes.first && bRes.second )
                 sp.release();
             return bRes;
@@ -373,7 +373,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool erase( Q const& key, Func f )
         {
-            return base_class::erase( key, [&f]( node_type const& node) { cds::unref(f)( node.m_Value ); } );
+            return base_class::erase( key, [&f]( node_type const& node) { f( node.m_Value ); } );
         }
 
         /// Deletes the item from the set using \p pred predicate for searching
@@ -387,7 +387,7 @@ namespace cds { namespace container {
         bool erase_with( Q const& key, Less pred, Func f )
         {
             return base_class::erase_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
-                [&f]( node_type const& node) { cds::unref(f)( node.m_Value ); } );
+                [&f]( node_type const& node) { f( node.m_Value ); } );
         }
 
         /// Extracts the item from the set with specified \p key
@@ -509,7 +509,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -527,7 +527,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q& val, Func f )
         {
-            return base_class::find( val, [&f]( node_type& node, Q& v ) { cds::unref(f)( node.m_Value, v ); });
+            return base_class::find( val, [&f]( node_type& node, Q& v ) { f( node.m_Value, v ); });
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -541,7 +541,7 @@ namespace cds { namespace container {
         bool find_with( Q& val, Less pred, Func f )
         {
             return base_class::find_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
-                [&f]( node_type& node, Q& v ) { cds::unref(f)( node.m_Value, v ); } );
+                [&f]( node_type& node, Q& v ) { f( node.m_Value, v ); } );
         }
 
         /// Find the key \p val
@@ -556,7 +556,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -571,7 +571,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q const& val, Func f )
         {
-            return base_class::find( val, [&f]( node_type& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); });
+            return base_class::find( val, [&f]( node_type& node, Q const& v ) { f( node.m_Value, v ); });
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -585,7 +585,7 @@ namespace cds { namespace container {
         bool find_with( Q const& val, Less cmp, Func f )
         {
             return base_class::find_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
-                [&f]( node_type& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); } );
+                [&f]( node_type& node, Q const& v ) { f( node.m_Value, v ); } );
         }
 
         /// Find the key \p val
index f05fc4446fb94f2cbd3ff1fd8fdddcd66c9e377d..f698242a452def449b99e21c0e139a8d1416cbc7 100644 (file)
@@ -387,7 +387,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 the inserting is successful.
 
             The key_type should be constructible from value of type \p K.
@@ -517,7 +517,7 @@ namespace cds { namespace container {
             scoped_node_ptr pNode( alloc_node( key ));
 
             if ( base_class::insert_at( &refHead, *pNode )) {
-                cds::unref(f)( pNode->m_Data );
+                f( pNode->m_Data );
                 return pNode.release();
             }
 
@@ -555,7 +555,7 @@ namespace cds { namespace container {
         template <typename K, typenam Compare, typename Func>
         bool find_at( head_type& refHead, K& key, Compare cmp, Func f )
         {
-            return base_class::find_at( &refHead, key, cmp, [&f]( node_type& node, K const& ){ cds::unref(f)( node.m_Data ); });
+            return base_class::find_at( &refHead, key, cmp, [&f]( node_type& node, K const& ){ f( node.m_Data ); });
         }
         */
         //@endcond
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>
index 745273f06f48b09f84ef697f4c9a4c55e247dd43..a3ff3e550d619593fa8339b9248b437e67dc6b44 100644 (file)
@@ -370,7 +370,7 @@ namespace cds { namespace container {
             The argument \p itemValue of user-defined functor \p func is the reference
             to the list's item inserted. 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 the inserting is success.
 
             The type \p Q should contain the complete key of the node.
@@ -429,7 +429,7 @@ namespace cds { namespace container {
             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 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 applies RCU lock internally.
 
@@ -610,9 +610,9 @@ namespace cds { namespace container {
                 void operator()( value_type& item, Q& val );
             };
             \endcode
-            where \p item is the item found, \p val is the <tt>find</tt> function argument.
+            where \p item is the item found, \p val is the \p find() function argument.
 
-            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 non-key fields of \p item. Note that the function is only guarantee
             that \p item cannot be deleted during functor is executing.
@@ -656,7 +656,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 function does not serialize simultaneous access to the list \p item. If such access is
             possible you must provide your own synchronization schema to exclude unsafe item modifications.
@@ -792,7 +792,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_to_value(node) ); } )) {
+            if ( base_class::insert_at( &refHead, *pNode, [&f](node_type& node){ f( node_to_value(node) ); } )) {
                 pNode.release();
                 return true;
             }
@@ -802,7 +802,7 @@ namespace cds { namespace container {
         template <typename Q, typename Compare, typename Func>
         bool erase_at( head_type& refHead, Q const& key, Compare cmp, Func f )
         {
-            return base_class::erase_at( &refHead, key, cmp, [&f](node_type const& node){ cds::unref(f)( node_to_value(node) ); } );
+            return base_class::erase_at( &refHead, key, cmp, [&f](node_type const& node){ f( node_to_value(node) ); } );
         }
 
         template <typename Q, typename Compare>
@@ -817,7 +817,7 @@ namespace cds { namespace container {
             scoped_node_ptr pNode( alloc_node( key ));
 
             std::pair<bool, bool> ret = base_class::ensure_at( &refHead, *pNode,
-                [&f, &key](bool bNew, node_type& node, node_type&){cds::unref(f)( bNew, node_to_value(node), key ); });
+                [&f, &key](bool bNew, node_type& node, node_type&){f( bNew, node_to_value(node), key ); });
             if ( ret.first && ret.second )
                 pNode.release();
 
@@ -833,7 +833,7 @@ namespace cds { namespace container {
         template <typename Q, typename Compare, typename Func>
         bool find_at( head_type& refHead, Q& val, Compare cmp, Func f ) const
         {
-            return base_class::find_at( &refHead, val, cmp, [&f](node_type& node, Q& val){ cds::unref(f)( node_to_value(node), val ); });
+            return base_class::find_at( &refHead, val, cmp, [&f](node_type& node, Q& val){ f( node_to_value(node), val ); });
         }
 
         template <typename Q, typename Compare>
index bae83d1b1660f091d66357d059b863eb69f3cdd7..b098279a52b79dfaacc1e425fda82884fb7831e6 100644 (file)
@@ -370,7 +370,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 the inserting is successful.
 
             The key_type should be constructible from value of type \p K.
@@ -500,7 +500,7 @@ namespace cds { namespace container {
             scoped_node_ptr pNode( alloc_node( key ));
 
             if ( base_class::insert_at( refHead, *pNode )) {
-                cds::unref(f)( pNode->m_Data );
+                f( pNode->m_Data );
                 return pNode.release();
             }
             return nullptr;
@@ -536,7 +536,7 @@ namespace cds { namespace container {
         template <typename K, typename Compare typename Func>
         bool find_at( head_type& refHead, K& key, Compare cmp, Func f )
         {
-            return base_class::find_at( refHead, key, cmp, [&f]( node_type& node, K const& ){ cds::unref(f)( node.m_Data ); });
+            return base_class::find_at( refHead, key, cmp, [&f]( node_type& node, K const& ){ f( node.m_Data ); });
         }
         */
         //@endcond
index aaf03ae703b518365c36f5c4f72d0121d3c31b25..679c6485d9f20e88ff11d396540792d25fa5eb21 100644 (file)
@@ -4,10 +4,10 @@
 #define __CDS_CONTAINER_MICHAEL_KVLIST_RCU_H
 
 #include <memory>
+#include <functional>   // ref
 #include <cds/container/details/michael_list_base.h>
 #include <cds/intrusive/michael_list_rcu.h>
 #include <cds/container/details/make_michael_kvlist.h>
-#include <cds/ref.h>
 #include <cds/details/functor_wrapper.h>
 
 namespace cds { namespace container {
@@ -379,7 +379,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.
@@ -427,7 +427,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.
 
@@ -615,7 +615,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.
@@ -751,7 +751,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;
             }
@@ -770,7 +770,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();
 
@@ -786,7 +786,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 Compare>
@@ -804,7 +804,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 const&){ cds::unref(f)( node.m_Data ); });
+            return base_class::find_at( refHead, key, cmp, [&f](node_type& node, K const&){ f( node.m_Data ); });
         }
 
         template <typename K, typename Compare>
index e7b0c09fd1cfcce856d90dadbd0845dd4ecb8c1b..40010e87ae134da32dc605971ab194a225dcd94b 100644 (file)
@@ -339,7 +339,7 @@ namespace cds { namespace container {
             The argument \p itemValue of user-defined functor \p func is the reference
             to the list's item inserted. 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 the inserting is success.
 
             The type \p Q should contain the complete key of the node.
@@ -386,7 +386,7 @@ namespace cds { namespace container {
             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 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.
 
@@ -581,7 +581,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the function is only guarantee
             that \p item cannot be deleted during functor is executing.
@@ -625,7 +625,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the function is only guarantee
             that \p item cannot be deleted during functor is executing.
@@ -756,7 +756,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_to_value(node) ); } )) {
+            if ( base_class::insert_at( refHead, *pNode, [&f]( node_type& node ) { f( node_to_value(node) ); } )) {
                 pNode.release();
                 return true;
             }
@@ -772,7 +772,7 @@ namespace cds { namespace container {
         template <typename Q, typename Compare, typename Func>
         bool erase_at( head_type& refHead, Q const& key, Compare cmp, Func f )
         {
-            return base_class::erase_at( refHead, key, cmp, [&f](node_type const& node){ cds::unref(f)( node_to_value(node) ); } );
+            return base_class::erase_at( refHead, key, cmp, [&f](node_type const& node){ f( node_to_value(node) ); } );
         }
 
         template <typename Q, typename Func>
@@ -781,7 +781,7 @@ namespace cds { namespace container {
             scoped_node_ptr pNode( alloc_node( key ));
 
             std::pair<bool, bool> ret = base_class::ensure_at( refHead, *pNode,
-                [&f, &key](bool bNew, node_type& node, node_type&){ cds::unref(f)( bNew, node_to_value(node), key ); });
+                [&f, &key](bool bNew, node_type& node, node_type&){ f( bNew, node_to_value(node), key ); });
             if ( ret.first && ret.second )
                 pNode.release();
 
@@ -803,7 +803,7 @@ namespace cds { namespace container {
         template <typename Q, typename Compare, typename Func>
         bool find_at( head_type& refHead, Q& val, Compare cmp, Func f ) const
         {
-            return base_class::find_at( refHead, val, cmp, [&f](node_type& node, Q& v){ cds::unref(f)( node_to_value(node), v ); });
+            return base_class::find_at( refHead, val, cmp, [&f](node_type& node, Q& v){ f( node_to_value(node), v ); });
         }
 
         template <typename Q, typename Compare>
index 6f4a387e49ddbf1365e0435633feae8e41af8f78..791492a7fab3d7bb82a07e1586f43309a0479276 100644 (file)
@@ -451,7 +451,7 @@ namespace cds { namespace container {
 
             User-defined functor \p func should guarantee that during changing item's value no any other changes
             could be made on this map'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.
@@ -501,7 +501,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
 
             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
@@ -667,7 +667,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 \p item.second. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
index 20a3e98af896130b1cf82baa8466939d53196682..44f50b5825c6ab0b9a457d7786f5ccdba813a9fa 100644 (file)
@@ -342,7 +342,7 @@ namespace cds { namespace container {
             to the map'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 map'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 the inserting is successful.
 
             The key_type should be constructible from value of type \p K.
index 02e886136427b73efc03aa7a52f9283e54a904eb..a4205a1bbbdb9ea0bc91e04867c284b1a72ffe03 100644 (file)
@@ -379,7 +379,7 @@ namespace cds { namespace container {
 
             User-defined functor \p func should guarantee that during changing item's value no any other changes
             could be made on this map'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.
@@ -431,7 +431,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 applies RCU lock internally.
 
@@ -619,7 +619,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 \p item.second. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
index 18e8a7b7a7cd9ebe22924783f96ed19a72b2bacd..49627a999cb98ecebfc029ab3d0221c01d5112d1 100644 (file)
@@ -356,7 +356,7 @@ namespace cds { namespace container {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
             The user-defined functor is called only if the inserting is success. It may be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref
         */
         template <typename Q, typename Func>
         bool insert( Q const& val, Func f )
@@ -392,7 +392,7 @@ namespace cds { namespace container {
             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 may pass \p func argument by reference using <tt>boost::ref</tt>.
+            You may pass \p func argument 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
@@ -566,7 +566,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -612,7 +612,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
index 9001e37f8be73c630d22ab5292051b73f035ee0d..279081b38a9929186ccac112128e9d9a71dfd512 100644 (file)
@@ -305,7 +305,7 @@ namespace cds { namespace container {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
             The user-defined functor is called only if the inserting is success. It may be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref
 
             The function applies RCU lock internally.
         */
@@ -343,7 +343,7 @@ namespace cds { namespace container {
             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 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 applies RCU lock internally.
 
@@ -541,7 +541,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -589,7 +589,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
index b2cdeb63cc2943ea9ccde4e1f0eccab2d61b381a..38ac55d234ecf83ebe7f1a831cea181c448bd859 100644 (file)
@@ -4,10 +4,10 @@
 #define __CDS_CONTAINER_MOIR_QUEUE_H
 
 #include <memory>
+#include <functional>   // ref
 #include <cds/intrusive/moir_queue.h>
 #include <cds/intrusive/details/queue_stat.h>
 #include <cds/container/details/base.h>
-#include <cds/ref.h>
 #include <cds/details/trivial_assign.h>
 
 namespace cds { namespace container {
@@ -211,7 +211,7 @@ namespace cds { namespace container {
         bool enqueue( const Type& data, Func f  )
         {
             scoped_node_ptr p( alloc_node());
-            unref(f)( node_traits::to_value_ptr( *p )->m_value, data );
+            f( node_traits::to_value_ptr( *p )->m_value, data );
             if ( base_class::enqueue( *p )) {
                 p.release();
                 return true;
@@ -242,7 +242,7 @@ namespace cds { namespace container {
         {
             typename base_class::dequeue_result res;
             if ( base_class::do_dequeue( res )) {
-                unref(f)( dest, node_traits::to_value_ptr( *res.pNext )->m_value );
+                f( dest, node_traits::to_value_ptr( *res.pNext )->m_value );
 
                 base_class::dispose_result( res );
 
index dda777f109036e4dbd88cdaad48293ebc4a9e9ec..c47a93067eb49d78178f7d4a2793e8a5e5acf841 100644 (file)
@@ -229,7 +229,7 @@ namespace cds { namespace container {
         {
             value_type * pVal = base_class::pop();
             if ( pVal ) {
-                cds::unref(f)( dest, *pVal );
+                f( dest, *pVal );
                 cxx_allocator().Delete( pVal );
                 return true;
             }
@@ -262,7 +262,7 @@ namespace cds { namespace container {
         template <typename Func>
         void clear_with( Func f )
         {
-            base_class::clear_with( [&f]( value_type& val ) { cds::unref(f)(val); value_deleter()( &val ); } );
+            base_class::clear_with( [&f]( value_type& val ) { f(val); value_deleter()( &val ); } );
         }
 
         /// Checks is the priority queue is empty
index c144bdb5e4b28a90c64392508ae5ee0a1fd56c35..4368c1cab60d2045e2543e8e33d180932cdf63f3 100644 (file)
@@ -4,9 +4,9 @@
 #define __CDS_CONTAINER_MSQUEUE_H
 
 #include <memory>
+#include <functional>   // ref
 #include <cds/intrusive/msqueue.h>
 #include <cds/container/details/base.h>
-#include <cds/ref.h>
 #include <cds/details/trivial_assign.h>
 
 namespace cds { namespace container {
@@ -222,7 +222,7 @@ namespace cds { namespace container {
         bool enqueue( Type const& data, Func f  )
         {
             scoped_node_ptr p( alloc_node() );
-            unref(f)( p->m_value, data );
+            f( p->m_value, data );
             if ( base_class::enqueue( *p )) {
                 p.release();
                 return true;
@@ -253,7 +253,7 @@ namespace cds { namespace container {
         {
             typename base_class::dequeue_result res;
             if ( base_class::do_dequeue( res )) {
-                unref(f)( dest, node_traits::to_value_ptr( *res.pNext )->m_value );
+                f( dest, node_traits::to_value_ptr( *res.pNext )->m_value );
 
                 base_class::dispose_result( res );
 
index 4ee76da3a3ef98fd57e6507fd9c86bc5ea5dbae8..bfe5e0789d814ac02e94b4d7017257c10b9780d2 100644 (file)
@@ -4,9 +4,9 @@
 #define __CDS_CONTAINER_OPTIMISTIC_QUEUE_H
 
 #include <memory>
+#include <functional>   // ref
 #include <cds/intrusive/optimistic_queue.h>
 #include <cds/container/details/base.h>
-#include <cds/ref.h>
 #include <cds/details/trivial_assign.h>
 
 namespace cds { namespace container {
@@ -231,7 +231,7 @@ namespace cds { namespace container {
         bool enqueue( const Type& data, Func f  )
         {
             scoped_node_ptr p( alloc_node() );
-            unref(f)( p->m_value, data );
+            f( p->m_value, data );
             if ( base_class::enqueue( *p )) {
                 p.release();
                 return true;
@@ -274,7 +274,7 @@ namespace cds { namespace container {
         {
             typename base_class::dequeue_result res;
             if ( base_class::do_dequeue( res )) {
-                unref(f)( dest, node_traits::to_value_ptr( *res.pNext )->m_value );
+                f( dest, node_traits::to_value_ptr( *res.pNext )->m_value );
 
                 base_class::dispose_result( res );
 
index 4b687dc9fab0a7920717dadc5d906b5cf345606b..b63d2ad03cfe391c3a4e22c7592832eead9566ac 100644 (file)
@@ -4,12 +4,12 @@
 #define __CDS_CONTAINER_RWQUEUE_H
 
 #include <memory>
+#include <functional>   // ref
 #include <cds/opt/options.h>
 #include <cds/lock/spinlock.h>
 #include <cds/intrusive/details/queue_stat.h>
 #include <cds/details/allocator.h>
 #include <cds/details/trivial_assign.h>
-#include <cds/ref.h>
 
 namespace cds { namespace container {
 
@@ -213,7 +213,7 @@ namespace cds { namespace container {
         bool enqueue( Type const& data, Func f  )
         {
             scoped_node_ptr p( alloc_node());
-            unref(f)( p->m_value, data );
+            f( p->m_value, data );
             if ( enqueue_node( p.get() )) {
                 p.release();
                 return true;
@@ -261,7 +261,7 @@ namespace cds { namespace container {
                 node_type * pNewHead = pNode->m_pNext;
                 if ( pNewHead == nullptr )
                     return false;
-                unref(f)( dest, pNewHead->m_value );
+                f( dest, pNewHead->m_value );
                 m_pHead = pNewHead;
             }    // unlock here
             --m_ItemCounter;
index ed5ad020fb67080e980310b2fdf3fcd3b8f65331..f5c506c87bdcaae6a5665bae6f73d000b8aa33cc 100644 (file)
@@ -4,9 +4,9 @@
 #define __CDS_CONTAINER_SEGMENTED_QUEUE_H
 
 #include <memory>
+#include <functional>   // ref
 #include <cds/intrusive/segmented_queue.h>
 #include <cds/details/trivial_assign.h>
-#include <cds/ref.h>
 
 namespace cds { namespace container {
 
@@ -272,7 +272,7 @@ namespace cds { namespace container {
         bool enqueue( Q const& data, Func f  )
         {
             scoped_node_ptr p( alloc_node() );
-            unref(f)( *p, data );
+            f( *p, data );
             if ( base_class::enqueue( *p )) {
                 p.release();
                 return true;
@@ -320,7 +320,7 @@ namespace cds { namespace container {
         {
             value_type * p = base_class::dequeue();
             if ( p ) {
-                unref(f)( dest, *p );
+                f( dest, *p );
                 gc::template retire< typename maker::node_disposer >( p );
                 return true;
             }
index 76644e65bcbc2fc98d93b1bf8be7fb2651d400c4..e4146eb9e82736c2dba0f83eb574b817a6225ab5 100644 (file)
@@ -238,7 +238,7 @@ namespace cds { namespace container {
             to the map'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 map'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 the inserting is successful.
 
             The key_type should be constructible from value of type \p K.
@@ -258,7 +258,7 @@ namespace cds { namespace container {
         {
             iterator it = insert( key );
             if ( it != end() )
-                cds::unref( func )( (*it) );
+                func( (*it) );
             return it;
         }
 
index cc8b9919526a7d761e850996326b9ea8be3b1a5c..213c2fb518a706bfdb703530d2a5085d398a7878 100644 (file)
@@ -282,7 +282,7 @@ namespace cds { namespace container {
                 - <tt>item.first</tt> is a const reference to item's key that cannot be changed.
                 - <tt>item.second</tt> is a reference to item's value that may be changed.
 
-            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.
@@ -301,7 +301,7 @@ namespace cds { namespace container {
         bool insert_key( const K& key, Func func )
         {
             scoped_node_ptr pNode( node_allocator().New( random_level(), key ));
-            if ( base_class::insert( *pNode, [&func]( node_type& item ) { cds::unref(func)( item.m_Value ); } )) {
+            if ( base_class::insert( *pNode, [&func]( node_type& item ) { func( item.m_Value ); } )) {
                 pNode.release();
                 return true;
             }
@@ -350,7 +350,7 @@ namespace cds { namespace container {
 
             The functor may change any fields of the \p item.second that is \ref value_type.
 
-            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
 
             RCU \p synchronize method can be called. RCU should not be locked.
 
@@ -363,7 +363,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( node_allocator().New( random_level(), key ));
             std::pair<bool, bool> res = base_class::ensure( *pNode,
-                [&func](bool bNew, node_type& item, node_type const& ){ cds::unref(func)( bNew, item.m_Value ); }
+                [&func](bool bNew, node_type& item, node_type const& ){ func( bNew, item.m_Value ); }
             );
             if ( res.first && res.second )
                 pNode.release();
@@ -417,7 +417,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool erase( K const& key, Func f )
         {
-            return base_class::erase( key, [&f]( node_type& node) { cds::unref(f)( node.m_Value ); } );
+            return base_class::erase( key, [&f]( node_type& node) { f( node.m_Value ); } );
         }
 
         /// Deletes the item from the map using \p pred predicate for searching
@@ -431,7 +431,7 @@ namespace cds { namespace container {
         bool erase_with( K const& key, Less pred, Func f )
         {
             return base_class::erase_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::key_accessor >(),
-                [&f]( node_type& node) { cds::unref(f)( node.m_Value ); } );
+                [&f]( node_type& node) { f( node.m_Value ); } );
         }
 
         /// Extracts the item from the map with specified \p key
@@ -512,7 +512,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found.
 
-            You can pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by reference using \p std::ref.
 
             The functor may change \p item.second.
 
@@ -523,7 +523,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-            return base_class::find( key, [&f](node_type& item, K const& ) { cds::unref(f)( item.m_Value );});
+            return base_class::find( key, [&f](node_type& item, K const& ) { f( item.m_Value );});
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -537,7 +537,7 @@ namespace cds { namespace container {
         bool find_with( K const& key, Less pred, Func f )
         {
             return base_class::find_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::key_accessor >(),
-                [&f](node_type& item, K const& ) { cds::unref(f)( item.m_Value );});
+                [&f](node_type& item, K const& ) { f( item.m_Value );});
         }
 
         /// Find the key \p key
index 632f2f9d78d6b0528e3909d2e75b4413df3f7428..1af003d62ad29be5a93b5c6224ad140c07bf3c85 100644 (file)
@@ -292,7 +292,7 @@ namespace cds { namespace container {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
             The user-defined functor is called only if the inserting is success. It may be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref
 
             RCU \p synchronize method can be called. RCU should not be locked.
         */
@@ -300,7 +300,7 @@ namespace cds { namespace container {
         bool insert( Q const& val, Func f )
         {
             scoped_node_ptr sp( node_allocator().New( random_level(), val ));
-            if ( base_class::insert( *sp.get(), [&f]( node_type& val ) { cds::unref(f)( val.m_Value ); } )) {
+            if ( base_class::insert( *sp.get(), [&f]( node_type& val ) { f( val.m_Value ); } )) {
                 sp.release();
                 return true;
             }
@@ -332,7 +332,7 @@ namespace cds { namespace container {
             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 may pass \p func argument by reference using <tt>boost::ref</tt>.
+            You may pass \p func argument by reference using \p std::ref
 
             RCU \p synchronize method can be called. RCU should not be locked.
 
@@ -345,7 +345,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr sp( node_allocator().New( random_level(), val ));
             std::pair<bool, bool> bRes = base_class::ensure( *sp,
-                [&func, &val](bool bNew, node_type& node, node_type&){ cds::unref(func)( bNew, node.m_Value, val ); });
+                [&func, &val](bool bNew, node_type& node, node_type&){ func( bNew, node.m_Value, val ); });
             if ( bRes.first && bRes.second )
                 sp.release();
             return bRes;
@@ -425,7 +425,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool erase( Q const& key, Func f )
         {
-            return base_class::erase( key, [&f]( node_type const& node) { cds::unref(f)( node.m_Value ); } );
+            return base_class::erase( key, [&f]( node_type const& node) { f( node.m_Value ); } );
         }
 
         /// Deletes the item from the set using \p pred predicate for searching
@@ -439,7 +439,7 @@ namespace cds { namespace container {
         bool erase_with( Q const& key, Less pred, Func f )
         {
             return base_class::erase_with( key, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
-                [&f]( node_type const& node) { cds::unref(f)( node.m_Value ); } );
+                [&f]( node_type const& node) { f( node.m_Value ); } );
         }
 
         /// Extracts the item from the set with specified \p key
@@ -521,7 +521,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -541,7 +541,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q& val, Func f )
         {
-            return base_class::find( val, [&f]( node_type& node, Q& v ) { cds::unref(f)( node.m_Value, v ); });
+            return base_class::find( val, [&f]( node_type& node, Q& v ) { f( node.m_Value, v ); });
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -555,7 +555,7 @@ namespace cds { namespace container {
         bool find_with( Q& val, Less pred, Func f )
         {
             return base_class::find_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
-                [&f]( node_type& node, Q& v ) { cds::unref(f)( node.m_Value, v ); } );
+                [&f]( node_type& node, Q& v ) { f( node.m_Value, v ); } );
         }
 
         /// Find the key \p val
@@ -570,7 +570,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -587,7 +587,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find( Q const& val, Func f )
         {
-            return base_class::find( val, [&f]( node_type& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); });
+            return base_class::find( val, [&f]( node_type& node, Q const& v ) { f( node.m_Value, v ); });
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -601,7 +601,7 @@ namespace cds { namespace container {
         bool find_with( Q const& val, Less pred, Func f )
         {
             return base_class::find_with( val, cds::details::predicate_wrapper< node_type, Less, typename maker::value_accessor >(),
-                [&f]( node_type& node, Q const& v ) { cds::unref(f)( node.m_Value, v ); } );
+                [&f]( node_type& node, Q const& v ) { f( node.m_Value, v ); } );
         }
 
         /// Find the key \p val
index eb8442c26da2ac2d8c7975dcf73d2ca67ff03c11..c1ba53d8460f38e5298e5a545dc6bc6b456c17df 100644 (file)
@@ -277,7 +277,7 @@ namespace cds { namespace container {
             User-defined functor \p func should guarantee that during changing item's value no any other changes
             could be made on this \p 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.
@@ -336,7 +336,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
 
             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
@@ -348,7 +348,7 @@ namespace cds { namespace container {
             //TODO: pass arguments by reference (make_pair makes copy)
             return base_class::ensure( std::make_pair( key, mapped_type() ),
                 [&func](bool bNew, value_type& item, value_type const& /*val*/) {
-                    cds::unref(func)( bNew, item );
+                    func( bNew, item );
                 } );
         }
 
@@ -470,7 +470,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 \p item.second. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -482,7 +482,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-            return base_class::find( key, [&f](value_type& pair, K const&){ cds::unref(f)( pair ); } );
+            return base_class::find( key, [&f](value_type& pair, K const&){ f( pair ); } );
         }
 
         /// Finds the key \p val using \p pred predicate for searching
@@ -497,7 +497,7 @@ namespace cds { namespace container {
         {
             return base_class::find_with( key,
                 cds::details::predicate_wrapper<value_type, Less, key_accessor>(),
-                [&f](value_type& pair, K const&){ cds::unref(f)( pair ); } );
+                [&f](value_type& pair, K const&){ f( pair ); } );
         }
 
         /// Finds the key \p key
index f7cbac3bfe50ea9b9a19539f7699452805ca9646..6df9038ae7a18c27f56fc4792affb06415c1e441 100644 (file)
@@ -184,7 +184,7 @@ namespace cds { namespace container {
             to the map'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 map'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 the inserting is successful.
 
             The key_type should be constructible from value of type \p K.
@@ -204,7 +204,7 @@ namespace cds { namespace container {
         {
             iterator it = insert( key );
             if ( it != end() )
-                cds::unref( func )( (*it) );
+                func( (*it) );
             return it;
         }
 
index cc94b7426221a69809ea0d88f56776cf3df7453f..c0a59c18f73b3206e9157c7ef717e96ff492c098 100644 (file)
@@ -318,7 +318,7 @@ namespace cds { namespace container {
             User-defined functor \p func should guarantee that during changing item's value no any other changes
             could be made on this \p 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.
@@ -381,7 +381,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 applies RCU lock internally.
 
@@ -395,7 +395,7 @@ namespace cds { namespace container {
             //TODO: pass arguments by reference (make_pair makes copy)
             return base_class::ensure( std::make_pair( key, mapped_type() ),
                 [&func](bool bNew, value_type& item, value_type const& /*val*/) {
-                    cds::unref(func)( bNew, item );
+                    func( bNew, item );
                 } );
         }
 
@@ -530,7 +530,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 \p item.second. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -544,7 +544,7 @@ namespace cds { namespace container {
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-            return base_class::find( key, [&f](value_type& pair, K const&){ cds::unref(f)( pair ); } );
+            return base_class::find( key, [&f](value_type& pair, K const&){ f( pair ); } );
         }
 
         /// Finds the key \p key using \p pred predicate for searching
@@ -559,7 +559,7 @@ namespace cds { namespace container {
         {
             return base_class::find_with( key,
                 cds::details::predicate_wrapper<value_type, Less, key_accessor>(),
-                [&f](value_type& pair, K const&){ cds::unref(f)( pair ); } );
+                [&f](value_type& pair, K const&){ f( pair ); } );
         }
 
         /// Finds the key \p key
index ebbf6a0b461399fe080cb7c20e9f7760f1bfb476..901067d3302ca2597d297c77456a1de71a82fe7d 100644 (file)
@@ -172,14 +172,14 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find_( Q& val, Func f )
         {
-            return base_class::find( val, [&f]( node_type& item, Q& val ) { cds::unref(f)(item.m_Value, val) ; } );
+            return base_class::find( val, [&f]( node_type& item, Q& val ) { f(item.m_Value, val) ; } );
         }
 
         template <typename Q, typename Less, typename Func>
         bool find_with_( Q& val, Less pred, Func f )
         {
             return base_class::find_with( val, typename maker::template predicate_wrapper<Less>::type(),
-                [&f]( node_type& item, Q& val ) { cds::unref(f)(item.m_Value, val) ; } );
+                [&f]( node_type& item, Q& val ) { f(item.m_Value, val) ; } );
         }
 
         template <typename... Args>
@@ -392,14 +392,14 @@ namespace cds { namespace container {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
             The user-defined functor is called only if the inserting is success. It may be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref
         */
         template <typename Q, typename Func>
         bool insert( Q const& val, Func f )
         {
             scoped_node_ptr pNode( alloc_node( val ));
 
-            if ( base_class::insert( *pNode, [&f](node_type& node) { cds::unref(f)( node.m_Value ) ; } )) {
+            if ( base_class::insert( *pNode, [&f](node_type& node) { f( node.m_Value ) ; } )) {
                 pNode.release();
                 return true;
             }
@@ -441,7 +441,7 @@ namespace cds { namespace container {
             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 may pass \p func argument by reference using <tt>boost::ref</tt>.
+            You may pass \p func argument 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
@@ -454,7 +454,7 @@ namespace cds { namespace container {
 
             std::pair<bool, bool> bRet = base_class::ensure( *pNode,
                 [&func, &val]( bool bNew, node_type& item,  node_type const& /*val*/ ) {
-                    cds::unref(func)( bNew, item.m_Value, val );
+                    func( bNew, item.m_Value, val );
                 } );
 
             if ( bRet.first && bRet.second )
@@ -513,7 +513,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool erase( Q const& key, Func f )
         {
-            return base_class::erase( key, [&f](node_type& node) { cds::unref(f)( node.m_Value ); } );
+            return base_class::erase( key, [&f](node_type& node) { f( node.m_Value ); } );
         }
 
         /// Deletes the item from the set using \p pred predicate for searching
@@ -527,7 +527,7 @@ namespace cds { namespace container {
         bool erase_with( Q const& key, Less pred, Func f )
         {
             return base_class::erase_with( key, typename maker::template predicate_wrapper<Less>::type(),
-                [&f](node_type& node) { cds::unref(f)( node.m_Value ); } );
+                [&f](node_type& node) { f( node.m_Value ); } );
         }
 
         /// Extracts the item with specified \p key
@@ -589,7 +589,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -635,7 +635,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
index 43101c4d4b215959e4debe9c92157252b84341fc..4c4fc5927246f4ddaeabc09e5efac1a8a1bfcf87 100644 (file)
@@ -217,14 +217,14 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool find_( Q& val, Func f )
         {
-            return base_class::find( val, [&f]( node_type& item, Q& val ) { cds::unref(f)(item.m_Value, val) ; } );
+            return base_class::find( val, [&f]( node_type& item, Q& val ) { f(item.m_Value, val) ; } );
         }
 
         template <typename Q, typename Less, typename Func>
         bool find_with_( Q& val, Less pred, Func f )
         {
             return base_class::find_with( val, typename maker::template predicate_wrapper<Less>::type(),
-                [&f]( node_type& item, Q& val ) { cds::unref(f)(item.m_Value, val) ; } );
+                [&f]( node_type& item, Q& val ) { f(item.m_Value, val) ; } );
         }
 
 
@@ -436,7 +436,7 @@ namespace cds { namespace container {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
             The user-defined functor is called only if the inserting is success. It may be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref
 
             The function applies RCU lock internally.
         */
@@ -445,7 +445,7 @@ namespace cds { namespace container {
         {
             scoped_node_ptr pNode( alloc_node( val ));
 
-            if ( base_class::insert( *pNode, [&f](node_type& node) { cds::unref(f)( node.m_Value ) ; } )) {
+            if ( base_class::insert( *pNode, [&f](node_type& node) { f( node.m_Value ) ; } )) {
                 pNode.release();
                 return true;
             }
@@ -489,7 +489,7 @@ namespace cds { namespace container {
             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 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 applies RCU lock internally.
 
@@ -504,7 +504,7 @@ namespace cds { namespace container {
 
             std::pair<bool, bool> bRet = base_class::ensure( *pNode,
                 [&func, &val]( bool bNew, node_type& item,  node_type const& /*val*/ ) {
-                    cds::unref(func)( bNew, item.m_Value, val );
+                    func( bNew, item.m_Value, val );
                 } );
             if ( bRet.first && bRet.second )
                 pNode.release();
@@ -568,7 +568,7 @@ namespace cds { namespace container {
         template <typename Q, typename Func>
         bool erase( Q const& key, Func f )
         {
-            return base_class::erase( key, [&f](node_type& node) { cds::unref(f)( node.m_Value ); } );
+            return base_class::erase( key, [&f](node_type& node) { f( node.m_Value ); } );
         }
 
         /// Deletes the item from the set using \p pred predicate for searching
@@ -582,7 +582,7 @@ namespace cds { namespace container {
         bool erase_with( Q const& key, Less pred, Func f )
         {
             return base_class::erase_with( key, typename maker::template predicate_wrapper<Less>::type(),
-                [&f](node_type& node) { cds::unref(f)( node.m_Value ); } );
+                [&f](node_type& node) { f( node.m_Value ); } );
         }
 
         /// Extracts an item from the set
@@ -663,7 +663,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -711,7 +711,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
index 892225cb46a481aeef431c507689ad6fe31cdbd6..6bfa88384f97abe2822b3277704107694ad285bc 100644 (file)
@@ -622,7 +622,7 @@ template <class Container, typename... Options>
                 - <tt>item.first</tt> is a const reference to item's key that cannot be changed.
                 - <tt>item.second</tt> is a reference to item's value that may be changed.
 
-            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.
@@ -691,7 +691,7 @@ template <class Container, typename... Options>
 
             The functor may change any fields of the \p item.second that is \ref mapped_type.
 
-            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
 
             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
@@ -800,7 +800,7 @@ template <class Container, typename... Options>
             \endcode
             where \p item is the item found.
 
-            You can pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by reference using \p std::ref.
 
             The functor may change \p item.second.
 
@@ -809,7 +809,7 @@ template <class Container, typename... Options>
         template <typename K, typename Func>
         bool find( K const& key, Func f )
         {
-            return base_class::find( key, [&f]( value_type& pair, K const& ) mutable { cds::unref(f)(pair); } );
+            return base_class::find( key, [&f]( value_type& pair, K const& ) mutable { f(pair); } );
         }
 
         /// Find the key \p val using \p pred predicate
@@ -828,7 +828,7 @@ template <class Container, typename... Options>
         bool find_with( K const& key, Less pred, Func f )
         {
             return base_class::find_with( key, cds::details::predicate_wrapper< value_type, Less, key_accessor >(),
-                [&f]( value_type& pair, K const& ) mutable { cds::unref(f)(pair); } );
+                [&f]( value_type& pair, K const& ) mutable { f(pair); } );
         }
 
         /// Find the key \p key
index 4869777e99ea5b01bc1a78d608436ce1e4c2e286..26e4409555df20b089a3df599376ed8e4db949bb 100644 (file)
@@ -8,11 +8,11 @@
 #   error "For boost::container::list you must use boost 1.48 or above"
 #endif
 
-#include <cds/container/striped_set/adapter.h>
-#include <cds/ref.h>
-#include <boost/container/list.hpp>
+#include <functional>   // ref
 #include <algorithm>    // std::lower_bound
 #include <utility>      // std::pair
+#include <cds/container/striped_set/adapter.h>
+#include <boost/container/list.hpp>
 
 //@cond
 namespace cds { namespace container {
@@ -140,7 +140,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 if ( it == m_List.end() || key_comparator()( key, it->first ) != 0 ) {
                     //value_type newItem( key );
                     it = m_List.insert( it, value_type( key, mapped_type()) );
-                    cds::unref( f )( *it );
+                    f( *it );
 
                     return true;
                 }
@@ -168,13 +168,13 @@ namespace cds { namespace intrusive { namespace striped_set {
                     // insert new
                     value_type newItem( key, mapped_type() );
                     it = m_List.insert( it, newItem );
-                    cds::unref( func )( true, *it );
+                    func( true, *it );
 
                     return std::make_pair( true, true );
                 }
                 else {
                     // already exists
-                    cds::unref( func )( false, *it );
+                    func( false, *it );
                     return std::make_pair( true, false );
                 }
             }
@@ -187,7 +187,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it );
+                f( *it );
                 m_List.erase( it );
 
                 return true;
@@ -201,7 +201,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it );
+                f( *it );
                 m_List.erase( it );
 
                 return true;
@@ -215,7 +215,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it, val );
+                f( *it, val );
                 return true;
             }
 
@@ -227,7 +227,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it, val );
+                f( *it, val );
                 return true;
             }
 
index 7ac83a899d7dfbfa5002c40dd514a79ebae972bc..87740a421eda751344887da9857ac87791be7345 100644 (file)
@@ -8,10 +8,10 @@
 #   error "For boost::container::slist you must use boost 1.48 or above"
 #endif
 
+#include <functional>   // ref
+#include <utility>      // std::pair
 #include <cds/container/striped_set/adapter.h>
-#include <cds/ref.h>
 #include <boost/container/slist.hpp>
-#include <utility>      // std::pair
 
 //@cond
 namespace cds { namespace container {
@@ -152,7 +152,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 if ( !pos.second ) {
                     value_type newItem( key, mapped_type() );
                     pos.first = m_List.insert_after( pos.first, newItem );
-                    cds::unref( f )( *pos.first );
+                    f( *pos.first );
                     return true;
                 }
 
@@ -179,12 +179,12 @@ namespace cds { namespace intrusive { namespace striped_set {
                     // insert new
                     value_type newItem( key, mapped_type() );
                     pos.first = m_List.insert_after( pos.first, newItem );
-                    cds::unref( func )( true, *pos.first );
+                    func( true, *pos.first );
                     return std::make_pair( true, true );
                 }
                 else {
                     // already exists
-                    cds::unref( func )( false, *(++pos.first) );
+                    func( false, *(++pos.first) );
                     return std::make_pair( true, false );
                 }
             }
@@ -198,7 +198,7 @@ namespace cds { namespace intrusive { namespace striped_set {
 
                 // key exists
                 iterator it = pos.first;
-                cds::unref( f )( *(++it) );
+                f( *(++it) );
                 m_List.erase_after( pos.first );
 
                 return true;
@@ -213,7 +213,7 @@ namespace cds { namespace intrusive { namespace striped_set {
 
                 // key exists
                 iterator it = pos.first;
-                cds::unref( f )( *(++it) );
+                f( *(++it) );
                 m_List.erase_after( pos.first );
 
                 return true;
@@ -227,7 +227,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *(++pos.first), val );
+                f( *(++pos.first), val );
                 return true;
             }
 
@@ -239,7 +239,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *(++pos.first), val );
+                f( *(++pos.first), val );
                 return true;
             }
 
index 58a8166c5ccc4bfc9c4047895e589651669b0b71..8738c9121900159a653ea4bad8debed770fedde7 100644 (file)
@@ -110,7 +110,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             {
                 std::pair<iterator, bool> res = m_Map.insert( value_type( key, mapped_type() ));
                 if ( res.second )
-                    ::cds::unref(f)( const_cast<value_type&>(*res.first) );
+                    ::f( const_cast<value_type&>(*res.first) );
                 return res.second;
             }
 
@@ -125,7 +125,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             std::pair<bool, bool> ensure( const Q& key, Func func )
             {
                 std::pair<iterator, bool> res = m_Map.insert( value_type( key, mapped_type() ) );
-                cds::unref(func)( res.second, const_cast<value_type&>(*res.first));
+                func( res.second, const_cast<value_type&>(*res.first));
                 return std::make_pair( true, res.second );
             }
 
@@ -135,7 +135,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 iterator it = m_Map.find( key_type(key) );
                 if ( it == m_Map.end() )
                     return false;
-                ::cds::unref(f)( const_cast<value_type&>(*it) );
+                ::f( const_cast<value_type&>(*it) );
                 m_Map.erase( it );
                 return true;
             }
@@ -146,7 +146,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 iterator it = m_Map.find( key_type(val) );
                 if ( it == m_Map.end() )
                     return false;
-                ::cds::unref(f)( const_cast<value_type&>(*it), val );
+                ::f( const_cast<value_type&>(*it), val );
                 return true;
             }
 
index 8850c6e010effe0e6ee7ca609f1f818bd7c1dc6a..81360899f6b967495a4233b7ff96bf0d0fdab1d3 100644 (file)
@@ -111,7 +111,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             {
                 std::pair<iterator, bool> res = m_Map.insert( value_type( key, mapped_type() ) );
                 if ( res.second )
-                    ::cds::unref(f)( *res.first );
+                    ::f( *res.first );
                 return res.second;
             }
 
@@ -119,7 +119,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             std::pair<bool, bool> ensure( const Q& val, Func func )
             {
                 std::pair<iterator, bool> res = m_Map.insert( value_type( val, mapped_type() ));
-                ::cds::unref(func)( res.second, *res.first );
+                ::func( res.second, *res.first );
                 return std::make_pair( true, res.second );
             }
 
@@ -129,7 +129,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 iterator it = m_Map.find( key_type(key) );
                 if ( it == m_Map.end() )
                     return false;
-                ::cds::unref(f)( *it );
+                ::f( *it );
                 m_Map.erase( it );
                 return true;
             }
@@ -140,7 +140,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 iterator it = m_Map.find( key_type(val) );
                 if ( it == m_Map.end() )
                     return false;
-                ::cds::unref(f)( *it, val );
+                ::f( *it, val );
                 return true;
             }
 
index 914dacbac043cb2aa20dc4ce7b86d946c4cc85dd..826fedcbb351bd0d6539c5c2413b1b20e0c8199b 100644 (file)
@@ -3,11 +3,11 @@
 #ifndef __CDS_CONTAINER_STRIPED_MAP_STD_LIST_ADAPTER_H
 #define __CDS_CONTAINER_STRIPED_MAP_STD_LIST_ADAPTER_H
 
-#include <cds/container/striped_set/adapter.h>
-#include <cds/ref.h>
 #include <list>
+#include <functional>   // ref
 #include <algorithm>    // std::lower_bound
 #include <utility>      // std::pair
+#include <cds/container/striped_set/adapter.h>
 
 //@cond
 namespace cds { namespace container {
@@ -145,7 +145,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 if ( it == m_List.end() || key_comparator()( key, it->first ) != 0 ) {
                     //value_type newItem( key );
                     it = m_List.insert( it, value_type( key, mapped_type()) );
-                    cds::unref( f )( *it );
+                    f( *it );
 
 #           ifdef __GLIBCXX__
                     ++m_nSize;
@@ -181,7 +181,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     // insert new
                     value_type newItem( key, mapped_type() );
                     it = m_List.insert( it, newItem );
-                    cds::unref( func )( true, *it );
+                    func( true, *it );
 #           ifdef __GLIBCXX__
                     ++m_nSize;
 #           endif
@@ -189,7 +189,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 }
                 else {
                     // already exists
-                    cds::unref( func )( false, *it );
+                    func( false, *it );
                     return std::make_pair( true, false );
                 }
             }
@@ -202,7 +202,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it );
+                f( *it );
                 m_List.erase( it );
 #           ifdef __GLIBCXX__
                 --m_nSize;
@@ -219,7 +219,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it );
+                f( *it );
                 m_List.erase( it );
 #           ifdef __GLIBCXX__
                 --m_nSize;
@@ -236,7 +236,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it, val );
+                f( *it, val );
                 return true;
             }
 
@@ -248,7 +248,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it, val );
+                f( *it, val );
                 return true;
             }
 
index 80810f42046e1d4ec34aec247e10812949b0dac0..6214b588d2bc2029af28754d6b840c9efc753ced 100644 (file)
@@ -106,7 +106,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             {
                 std::pair<iterator, bool> res = m_Map.insert( value_type( key, mapped_type() ) );
                 if ( res.second )
-                    ::cds::unref(f)( *res.first );
+                    ::f( *res.first );
                 return res.second;
             }
 
@@ -121,7 +121,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             std::pair<bool, bool> ensure( const Q& key, Func func )
             {
                 std::pair<iterator, bool> res = m_Map.insert( value_type( key, mapped_type() ));
-                cds::unref(func)( res.second, *res.first );
+                func( res.second, *res.first );
                 return std::make_pair( true, res.second );
             }
 
@@ -131,7 +131,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 iterator it = m_Map.find( key_type(key) );
                 if ( it == m_Map.end() )
                     return false;
-                cds::unref(f)( *it );
+                f( *it );
                 m_Map.erase( it );
                 return true;
             }
@@ -142,7 +142,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 iterator it = m_Map.find( key_type(val) );
                 if ( it == m_Map.end() )
                     return false;
-                cds::unref(f)( *it, val );
+                f( *it, val );
                 return true;
             }
 
index 8c82d5be3a28496328366db21d8bb3f34ea88def..18147ba500b155d641d4f8daa6e756533688869a 100644 (file)
@@ -589,7 +589,7 @@ namespace cds { namespace container {
             Therefore, the \p value_type should be constructible from type \p Q.
 
             The user-defined functor is called only if the inserting is success. It can be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref
         */
         template <typename Q, typename Func>
         bool insert( Q const& val, Func f )
@@ -658,7 +658,7 @@ namespace cds { namespace container {
 
             The functor can change non-key fields of the \p item.
 
-            You can pass \p func argument by value or by reference using <tt>boost::ref</tt>.
+            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 val key
@@ -788,7 +788,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item.
             The \p val argument is non-const since it can be used as \p f functor destination i.e., the functor
@@ -835,7 +835,7 @@ namespace cds { namespace container {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item.
 
index 3367678e58395d10e1fe94b5a69fcd43fb1d2b9e..fb2a34e690e83ad235722b9e22df60d839f726be 100644 (file)
@@ -63,7 +63,7 @@ namespace cds { namespace container {
                 Therefore, the \p value_type should be comparable with type \p Q and constructible from type \p Q,
 
                 The user-defined functor is called only if the inserting is success. It can be passed by reference
-                using <tt>boost::ref</tt>
+                using \p std::ref
                 <hr>
 
             <b>Inserts data of type \ref value_type constructed with <tt>std::forward<Args>(args)...</tt></b>
@@ -101,7 +101,7 @@ namespace cds { namespace container {
                 The type \p Q can differ from \ref value_type of items storing in the container.
                 Therefore, the \p value_type should be comparable with type \p Q and constructible from type \p Q,
 
-                You can pass \p func argument by reference using <tt>boost::ref</tt>.
+                You can pass \p func argument 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 val key
@@ -140,7 +140,7 @@ namespace cds { namespace container {
                 \endcode
                 where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-                You can pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+                You can pass \p f argument by reference using \p std::ref
 
                 The functor can change non-key fields of \p item.
                 The \p val argument is non-const since it can be used as \p f functor destination i.e., the functor
@@ -266,7 +266,7 @@ namespace cds { namespace container {
                 {
                     std::pair<iterator, bool> res = m_Set.insert( value_type(val) );
                     if ( res.second )
-                        cds::unref(f)( const_cast<value_type&>(*res.first) );
+                        f( const_cast<value_type&>(*res.first) );
                     return res.second;
                 }
 
@@ -281,7 +281,7 @@ namespace cds { namespace container {
                 std::pair<bool, bool> ensure( const Q& val, Func func )
                 {
                     std::pair<iterator, bool> res = m_Set.insert( value_type(val) );
-                    cds::unref(func)( res.second, const_cast<value_type&>(*res.first), val );
+                    func( res.second, const_cast<value_type&>(*res.first), val );
                     return std::make_pair( true, res.second );
                 }
 
@@ -291,7 +291,7 @@ namespace cds { namespace container {
                     const_iterator it = m_Set.find( value_type(key) );
                     if ( it == m_Set.end() )
                         return false;
-                    cds::unref(f)( const_cast<value_type&>(*it) );
+                    f( const_cast<value_type&>(*it) );
                     m_Set.erase( it );
                     return true;
                 }
@@ -302,7 +302,7 @@ namespace cds { namespace container {
                     iterator it = m_Set.find( value_type(val) );
                     if ( it == m_Set.end() )
                         return false;
-                    cds::unref(f)( const_cast<value_type&>(*it), val );
+                    f( const_cast<value_type&>(*it), val );
                     return true;
                 }
 
@@ -403,7 +403,7 @@ namespace cds { namespace container {
                 {
                     std::pair<iterator, bool> res = m_Map.insert( value_type( key, mapped_type() ) );
                     if ( res.second )
-                        cds::unref(f)( *res.first );
+                        f( *res.first );
                     return res.second;
                 }
 
@@ -418,7 +418,7 @@ namespace cds { namespace container {
                 std::pair<bool, bool> ensure( const Q& val, Func func )
                 {
                     std::pair<iterator, bool> res = m_Map.insert( value_type( val, mapped_type() ));
-                    cds::unref(func)( res.second, *res.first );
+                    func( res.second, *res.first );
                     return std::make_pair( true, res.second );
                 }
 
@@ -428,7 +428,7 @@ namespace cds { namespace container {
                     iterator it = m_Map.find( key_type(key) );
                     if ( it == m_Map.end() )
                         return false;
-                    cds::unref(f)( *it );
+                    f( *it );
                     m_Map.erase( it );
                     return true;
                 }
@@ -439,7 +439,7 @@ namespace cds { namespace container {
                     iterator it = m_Map.find( key_type(val) );
                     if ( it == m_Map.end() )
                         return false;
-                    cds::unref(f)( *it, val );
+                    f( *it, val );
                     return true;
                 }
 
index 8dad1316df0434ba33e385a4fa294089ebc1ff3b..399f68d3b31afb7df22ff2c7d7fef7114599b0be 100644 (file)
@@ -8,10 +8,10 @@
 #   error "For boost::container::list you must use boost 1.48 or above"
 #endif
 
+#include <algorithm>    // std::lower_bound
+#include <functional>   // ref
 #include <cds/container/striped_set/adapter.h>
-#include <cds/ref.h>
 #include <boost/container/list.hpp>
-#include <algorithm>    // std::lower_bound
 
 //@cond
 namespace cds { namespace container {
@@ -134,7 +134,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 if ( it == m_List.end() || key_comparator()( val, *it ) != 0 ) {
                     value_type newItem( val );
                     it = m_List.insert( it, newItem );
-                    cds::unref( f )( *it );
+                    f( *it );
 
                     return true;
                 }
@@ -163,12 +163,12 @@ namespace cds { namespace intrusive { namespace striped_set {
                     // insert new
                     value_type newItem( val );
                     it = m_List.insert( it, newItem );
-                    cds::unref( func )( true, *it, val );
+                    func( true, *it, val );
                     return std::make_pair( true, true );
                 }
                 else {
                     // already exists
-                    cds::unref( func )( false, *it, val );
+                    func( false, *it, val );
                     return std::make_pair( true, false );
                 }
             }
@@ -181,7 +181,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it );
+                f( *it );
                 m_List.erase( it );
 
                 return true;
@@ -195,7 +195,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it );
+                f( *it );
                 m_List.erase( it );
 
                 return true;
@@ -209,7 +209,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it, val );
+                f( *it, val );
                 return true;
             }
 
@@ -221,7 +221,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it, val );
+                f( *it, val );
                 return true;
             }
 
index baa8468b2a69b941687ff0acd5dac1e34fa20966..18097caebc4b1e8121980c3cd94c6e3af41b7d66 100644 (file)
@@ -3,8 +3,8 @@
 #ifndef __CDS_CONTAINER_STRIPED_SET_BOOST_SLIST_ADAPTER_H
 #define __CDS_CONTAINER_STRIPED_SET_BOOST_SLIST_ADAPTER_H
 
+#include <functional>   // ref
 #include <cds/container/striped_set/adapter.h>
-#include <cds/ref.h>
 #include <boost/container/slist.hpp>
 
 //@cond
@@ -143,7 +143,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 if ( !pos.second ) {
                     value_type newItem( val );
                     pos.first = m_List.insert_after( pos.first, newItem );
-                    cds::unref( f )( *pos.first );
+                    f( *pos.first );
                     return true;
                 }
 
@@ -171,12 +171,12 @@ namespace cds { namespace intrusive { namespace striped_set {
                     // insert new
                     value_type newItem( val );
                     pos.first = m_List.insert_after( pos.first, newItem );
-                    cds::unref( func )( true, *pos.first, val );
+                    func( true, *pos.first, val );
                     return std::make_pair( true, true );
                 }
                 else {
                     // already exists
-                    cds::unref( func )( false, *(++pos.first), val );
+                    func( false, *(++pos.first), val );
                     return std::make_pair( true, false );
                 }
             }
@@ -190,7 +190,7 @@ namespace cds { namespace intrusive { namespace striped_set {
 
                 // key exists
                 iterator it = pos.first;
-                cds::unref( f )( *(++it) );
+                f( *(++it) );
                 m_List.erase_after( pos.first );
 
                 return true;
@@ -205,7 +205,7 @@ namespace cds { namespace intrusive { namespace striped_set {
 
                 // key exists
                 iterator it = pos.first;
-                cds::unref( f )( *(++it) );
+                f( *(++it) );
                 m_List.erase_after( pos.first );
 
                 return true;
@@ -219,7 +219,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *(++pos.first), val );
+                f( *(++pos.first), val );
                 return true;
             }
 
@@ -231,7 +231,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *(++pos.first), val );
+                f( *(++pos.first), val );
                 return true;
             }
 
index 77537881b65eacc0af0414230b91764e7f544c96..9a8b8062c84d1050c4f888127c8750275933cc1a 100644 (file)
@@ -8,11 +8,11 @@
 #   error "For boost::container::stable_vector you must use boost 1.48 or above"
 #endif
 
-#include <cds/container/striped_set/adapter.h>
-#include <cds/ref.h>
-#include <boost/container/stable_vector.hpp>
+#include <functional>   // ref
 #include <algorithm>    // std::lower_bound
 #include <utility>      // std::pair
+#include <cds/container/striped_set/adapter.h>
+#include <boost/container/stable_vector.hpp>
 
 //@cond
 namespace cds { namespace container {
@@ -143,7 +143,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 Therefore, the \p value_type should be comparable with type \p Q and constructible from type \p Q,
 
                 The user-defined functor is called only if the inserting is success. It may be passed by reference
-                using <tt>boost::ref</tt>
+                using \p std::ref
             */
             template <typename Q, typename Func>
             bool insert( const Q& val, Func f )
@@ -152,7 +152,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 if ( it == m_Vector.end() || key_comparator()( val, *it ) != 0 ) {
                     value_type newItem( val );
                     it = m_Vector.insert( it, newItem );
-                    cds::unref( f )( *it );
+                    f( *it );
                     return true;
                 }
                 return false;
@@ -197,7 +197,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 The type \p Q may differ from \ref value_type of items storing in the container.
                 Therefore, the \p value_type should be comparable with type \p Q and constructible from type \p Q,
 
-                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
 
                 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 val key
@@ -211,12 +211,12 @@ namespace cds { namespace intrusive { namespace striped_set {
                     // insert new
                     value_type newItem( val );
                     it = m_Vector.insert( it, newItem );
-                    cds::unref( func )( true, *it, val );
+                    func( true, *it, val );
                     return std::make_pair( true, true );
                 }
                 else {
                     // already exists
-                    cds::unref( func )( false, *it, val );
+                    func( false, *it, val );
                     return std::make_pair( true, false );
                 }
             }
@@ -247,7 +247,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it );
+                f( *it );
                 m_Vector.erase( it );
                 return true;
             }
@@ -260,7 +260,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it );
+                f( *it );
                 m_Vector.erase( it );
                 return true;
             }
@@ -276,7 +276,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 \endcode
                 where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-                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 non-key fields of \p item.
                 The \p val argument is non-const since it can be used as \p f functor destination i.e., the functor
@@ -295,7 +295,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it, val );
+                f( *it, val );
                 return true;
             }
 
@@ -307,7 +307,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it, val );
+                f( *it, val );
                 return true;
             }
 
index a9fbfe9d35470173025896f82b5aad419adb11aa..52db5eca6da8fe232eef86d30153122270e8260a 100644 (file)
@@ -8,11 +8,11 @@
 #   error "For boost::container::vector you must use boost 1.48 or above"
 #endif
 
-#include <cds/container/striped_set/adapter.h>     // lower_bound
-#include <cds/ref.h>
-#include <boost/container/vector.hpp>
+#include <functional>   // ref
 #include <algorithm>    // std::lower_bound
 #include <utility>      // std::pair
+#include <cds/container/striped_set/adapter.h>     // lower_bound
+#include <boost/container/vector.hpp>
 
 //@cond
 namespace cds { namespace container {
@@ -132,7 +132,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 if ( it == m_Vector.end() || key_comparator()( val, *it ) != 0 ) {
                     value_type newItem( val );
                     it = m_Vector.insert( it, newItem );
-                    cds::unref( f )( *it );
+                    f( *it );
                     return true;
                 }
                 return false;
@@ -158,12 +158,12 @@ namespace cds { namespace intrusive { namespace striped_set {
                     // insert new
                     value_type newItem( val );
                     it = m_Vector.insert( it, newItem );
-                    cds::unref( func )( true, *it, val );
+                    func( true, *it, val );
                     return std::make_pair( true, true );
                 }
                 else {
                     // already exists
-                    cds::unref( func )( false, *it, val );
+                    func( false, *it, val );
                     return std::make_pair( true, false );
                 }
             }
@@ -176,7 +176,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it );
+                f( *it );
                 m_Vector.erase( it );
                 return true;
             }
@@ -189,7 +189,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it );
+                f( *it );
                 m_Vector.erase( it );
                 return true;
             }
@@ -202,7 +202,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it, val );
+                f( *it, val );
                 return true;
             }
 
@@ -214,7 +214,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it, val );
+                f( *it, val );
                 return true;
             }
 
index e0254c9c45dd26b5b11e8be4b51bcbf3dae685ed..72cb3fc1079a68dd23462a9d1614c01916372f8c 100644 (file)
@@ -93,7 +93,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             {
                 std::pair<iterator, bool> res = m_Set.insert( value_type(val) );
                 if ( res.second )
-                    ::cds::unref(f)( const_cast<value_type&>(*res.first) );
+                    ::f( const_cast<value_type&>(*res.first) );
                 return res.second;
             }
 
@@ -108,7 +108,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             std::pair<bool, bool> ensure( const Q& val, Func func )
             {
                 std::pair<iterator, bool> res = m_Set.insert( value_type(val) );
-                cds::unref(func)( res.second, const_cast<value_type&>(*res.first), val );
+                func( res.second, const_cast<value_type&>(*res.first), val );
                 return std::make_pair( true, res.second );
             }
 
@@ -118,7 +118,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 const_iterator it = m_Set.find( value_type(key) );
                 if ( it == m_Set.end() )
                     return false;
-                cds::unref(f)( const_cast<value_type&>(*it) );
+                f( const_cast<value_type&>(*it) );
                 m_Set.erase( it );
                 return true;
             }
@@ -129,7 +129,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 iterator it = m_Set.find( value_type(val) );
                 if ( it == m_Set.end() )
                     return false;
-                cds::unref(f)( const_cast<value_type&>(*it), val );
+                f( const_cast<value_type&>(*it), val );
                 return true;
             }
 
index 352e30e86d9c16b1a4b67c9edadf9f7c4b555e67..765a0698538db118e86faba3a64226565d6dcce6 100644 (file)
@@ -95,7 +95,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             {
                 std::pair<iterator, bool> res = m_Set.insert( value_type(val) );
                 if ( res.second )
-                    ::cds::unref(f)( *res.first );
+                    ::f( *res.first );
                 return res.second;
             }
 
@@ -103,7 +103,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             std::pair<bool, bool> ensure( const Q& val, Func func )
             {
                 std::pair<iterator, bool> res = m_Set.insert( value_type(val) );
-                ::cds::unref(func)( res.second, *res.first, val );
+                ::func( res.second, *res.first, val );
                 return std::make_pair( true, res.second );
             }
 
@@ -113,7 +113,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 iterator it = m_Set.find( value_type(key) );
                 if ( it == m_Set.end() )
                     return false;
-                ::cds::unref(f)( *it );
+                ::f( *it );
                 m_Set.erase( it );
                 return true;
             }
@@ -124,7 +124,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 iterator it = m_Set.find( value_type(val) );
                 if ( it == m_Set.end() )
                     return false;
-                ::cds::unref(f)( *it, val );
+                ::f( *it, val );
                 return true;
             }
 
index 50411b0688abd4c5a835bccbadef1b9658f6a087..8399f04e3c3f3107c737b25641163e2ba44706fc 100644 (file)
@@ -3,10 +3,10 @@
 #ifndef __CDS_CONTAINER_STRIPED_SET_STD_LIST_ADAPTER_H
 #define __CDS_CONTAINER_STRIPED_SET_STD_LIST_ADAPTER_H
 
-#include <cds/container/striped_set/adapter.h>
-#include <cds/ref.h>
+#include <functional>   // ref
 #include <list>
 #include <algorithm>    // std::lower_bound
+#include <cds/container/striped_set/adapter.h>
 
 //@cond
 namespace cds { namespace container {
@@ -139,7 +139,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 if ( it == m_List.end() || key_comparator()( val, *it ) != 0 ) {
                     value_type newItem( val );
                     it = m_List.insert( it, newItem );
-                    cds::unref( f )( *it );
+                    f( *it );
 
 #           ifdef __GLIBCXX__
                     ++m_nSize;
@@ -180,7 +180,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     // insert new
                     value_type newItem( val );
                     it = m_List.insert( it, newItem );
-                    cds::unref( func )( true, *it, val );
+                    func( true, *it, val );
 #           ifdef __GLIBCXX__
                     ++m_nSize;
 #           endif
@@ -188,7 +188,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 }
                 else {
                     // already exists
-                    cds::unref( func )( false, *it, val );
+                    func( false, *it, val );
                     return std::make_pair( true, false );
                 }
             }
@@ -201,7 +201,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it );
+                f( *it );
                 m_List.erase( it );
 #           ifdef __GLIBCXX__
                 --m_nSize;
@@ -218,7 +218,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it );
+                f( *it );
                 m_List.erase( it );
 #           ifdef __GLIBCXX__
                 --m_nSize;
@@ -235,7 +235,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it, val );
+                f( *it, val );
                 return true;
             }
 
@@ -247,7 +247,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it, val );
+                f( *it, val );
                 return true;
             }
 
index 6f2379467f56e3b1cde31baaf95762ec4d8ead13..b64c5cdcae52fc82b9179b8830f057a76e45a2e3 100644 (file)
@@ -90,7 +90,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             {
                 std::pair<iterator, bool> res = m_Set.insert( value_type(val) );
                 if ( res.second )
-                    ::cds::unref(f)( const_cast<value_type&>(*res.first) );
+                    ::f( const_cast<value_type&>(*res.first) );
                 return res.second;
             }
 
@@ -105,7 +105,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             std::pair<bool, bool> ensure( const Q& val, Func func )
             {
                 std::pair<iterator, bool> res = m_Set.insert( value_type(val) );
-                ::cds::unref(func)( res.second, const_cast<value_type&>(*res.first), val );
+                ::func( res.second, const_cast<value_type&>(*res.first), val );
                 return std::make_pair( true, res.second );
             }
 
@@ -115,7 +115,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 iterator it = m_Set.find( value_type(key) );
                 if ( it == m_Set.end() )
                     return false;
-                ::cds::unref(f)( const_cast<value_type&>(*it) );
+                ::f( const_cast<value_type&>(*it) );
                 m_Set.erase( it );
                 return true;
             }
@@ -126,7 +126,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 iterator it = m_Set.find( value_type(val) );
                 if ( it == m_Set.end() )
                     return false;
-                ::cds::unref(f)( const_cast<value_type&>(*it), val );
+                ::f( const_cast<value_type&>(*it), val );
                 return true;
             }
 
index e1e9169fd52b3aceffed570daa346b5173e53ce4..1e19993b6cb1110a69bc525d4b6cb61f190956e3 100644 (file)
@@ -3,11 +3,11 @@
 #ifndef __CDS_CONTAINER_STRIPED_SET_STD_VECTOR_ADAPTER_H
 #define __CDS_CONTAINER_STRIPED_SET_STD_VECTOR_ADAPTER_H
 
-#include <cds/container/striped_set/adapter.h>     // lower_bound
-#include <cds/ref.h>
+#include <functional>   // ref
 #include <vector>
 #include <algorithm>    // std::lower_bound
 #include <utility>      // std::pair
+#include <cds/container/striped_set/adapter.h>     // lower_bound
 
 //@cond
 namespace cds { namespace container {
@@ -129,7 +129,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 if ( it == m_Vector.end() || key_comparator()( val, *it ) != 0 ) {
                     value_type newItem( val );
                     it = m_Vector.insert( it, newItem );
-                    cds::unref( f )( *it );
+                    f( *it );
                     return true;
                 }
                 return false;
@@ -161,12 +161,12 @@ namespace cds { namespace intrusive { namespace striped_set {
                     // insert new
                     value_type newItem( val );
                     it = m_Vector.insert( it, newItem );
-                    cds::unref( func )( true, *it, val );
+                    func( true, *it, val );
                     return std::make_pair( true, true );
                 }
                 else {
                     // already exists
-                    cds::unref( func )( false, *it, val );
+                    func( false, *it, val );
                     return std::make_pair( true, false );
                 }
             }
@@ -179,7 +179,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it );
+                f( *it );
                 m_Vector.erase( it );
                 return true;
             }
@@ -192,7 +192,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it );
+                f( *it );
                 m_Vector.erase( it );
                 return true;
             }
@@ -205,7 +205,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it, val );
+                f( *it, val );
                 return true;
             }
 
@@ -217,7 +217,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it, val );
+                f( *it, val );
                 return true;
             }
 
index 96388898f273d5d55e6b7a8009e5e55d461698da..cf09e502c2def8ef3a71befe3ad226c5c024cabe 100644 (file)
@@ -224,7 +224,7 @@ namespace cds { namespace container {
         bool enqueue( const Type& data, Func f  )
         {
             scoped_node_ptr p( alloc_node());
-            unref(f)( *p, data );
+            f( *p, data );
             if ( base_class::enqueue( *p )) {
                 p.release();
                 return true;
@@ -267,7 +267,7 @@ namespace cds { namespace container {
         {
             value_type * p = base_class::dequeue();
             if ( p ) {
-                unref(f)( dest, *p );
+                f( dest, *p );
                 node_disposer()( p );
                 return true;
             }
index 1d7aa89974f277d199e08292888e9a8a44815175..2c2a7bf9bfaf5720ca015e70a2bc14fcc8e984d5 100644 (file)
@@ -3,11 +3,11 @@
 #ifndef __CDS_CONTAINER_VYUKOV_MPMC_CYCLE_QUEUE_H
 #define __CDS_CONTAINER_VYUKOV_MPMC_CYCLE_QUEUE_H
 
+#include <functional>   // ref
 #include <cds/container/details/base.h>
 #include <cds/opt/buffer.h>
 #include <cds/opt/value_cleaner.h>
 #include <cds/cxx11_atomic.h>
-#include <cds/ref.h>
 #include <cds/details/trivial_assign.h>
 #include <cds/details/bounded_container.h>
 
@@ -194,7 +194,7 @@ namespace cds { namespace container {
                     pos = m_posEnqueue.load(memory_model::memory_order_relaxed);
             }
 
-            unref(func)( cell->data, data );
+            func( cell->data, data );
 
             cell->sequence.store(pos + 1, memory_model::memory_order_release);
             ++m_ItemCounter;
@@ -280,7 +280,7 @@ namespace cds { namespace container {
                     pos = m_posDequeue.load(memory_model::memory_order_relaxed);
             }
 
-            unref(func)( data, cell->data );
+            func( data, cell->data );
             value_cleaner()( cell->data );
             --m_ItemCounter;
             cell->sequence.store( pos + m_nBufferMask + 1, memory_model::memory_order_release );
index a8ca972f46aae9b96e39700b6c134e5218ec096b..3ee34fcc24749760b591b3eb9fc491d07c7ec5a3 100644 (file)
@@ -3,7 +3,7 @@
 #ifndef __CDS_DETAILS_FUNCTOR_WRAPPER_H
 #define __CDS_DETAILS_FUNCTOR_WRAPPER_H
 
-#include <cds/ref.h>
+#include <functional>   // ref
 
 //@cond
 namespace cds { namespace details {
index c556e81637db1cfed8937536c9d2d06ce8e48a91..46f2ca0adeeaccca81d52419e75a61d2d72c050d 100644 (file)
@@ -4,11 +4,11 @@
 #define __CDS_INTRUSIVE_BASKET_QUEUE_H
 
 #include <type_traits>
+#include <functional>   // ref
 #include <cds/intrusive/details/base.h>
 #include <cds/details/marked_ptr.h>
 #include <cds/intrusive/details/queue_stat.h>
 #include <cds/intrusive/details/single_link_struct.h>
-#include <cds/ref.h>
 #include <cds/intrusive/details/dummy_node_holder.h>
 
 namespace cds { namespace intrusive {
index 87404c7a23a5f4da2169ce091ccb289618a54642..6815bb7ac0993c575a705a2bda63f138eff8479b 100644 (file)
@@ -6,11 +6,11 @@
 #include <memory>
 #include <type_traits>
 #include <mutex>
+#include <functional>   // ref
 #include <cds/intrusive/details/base.h>
 #include <cds/opt/compare.h>
 #include <cds/opt/hash.h>
 #include <cds/lock/array.h>
-#include <cds/ref.h>
 #include <cds/os/thread.h>
 #include <cds/details/functor_wrapper.h>
 #include <cds/lock/spinlock.h>
@@ -1316,7 +1316,7 @@ namespace cds { namespace intrusive {
                     for ( node_type * pNode = pHead; pNode; pNode = pNext ) {
                         pNext = pNode->m_pNext;
                         pNode->clear();
-                        cds::unref(disp)( pNode );
+                        disp( pNode );
                     }
 
                     nSize = 0;
@@ -1465,7 +1465,7 @@ namespace cds { namespace intrusive {
                 void clear( Disposer disp )
                 {
                     for ( unsigned int i = 0; i < m_nSize; ++i ) {
-                        cds::unref(disp)( m_arrNode[i] );
+                        disp( m_arrNode[i] );
                     }
                     m_nSize = 0;
                 }
@@ -2035,7 +2035,7 @@ namespace cds { namespace intrusive {
                 unsigned int nTable = contains( arrPos, arrHash, val, pred );
                 if ( nTable != c_nUndefTable ) {
                     node_type& node = *arrPos[nTable].itFound;
-                    cds::unref(f)( *node_traits::to_value_ptr(node) );
+                    f( *node_traits::to_value_ptr(node) );
                     bucket( nTable, arrHash[nTable]).remove( arrPos[nTable].itPrev, arrPos[nTable].itFound );
                     --m_ItemCounter;
                     m_Stat.onEraseSuccess();
@@ -2057,7 +2057,7 @@ namespace cds { namespace intrusive {
 
             unsigned int nTable = contains( arrPos, arrHash, val, pred );
             if ( nTable != c_nUndefTable ) {
-                cds::unref(f)( *node_traits::to_value_ptr( *arrPos[nTable].itFound ), val );
+                f( *node_traits::to_value_ptr( *arrPos[nTable].itFound ), val );
                 m_Stat.onFindSuccess();
                 return true;
             }
@@ -2367,7 +2367,7 @@ namespace cds { namespace intrusive {
             where \p val is the item inserted.
 
             The user-defined functor is called only if the inserting is success and can be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref
         */
         template <typename Func>
         bool insert( value_type& val, Func f )
@@ -2393,7 +2393,7 @@ namespace cds { namespace intrusive {
                         bucket_entry& refBucket = bucket( i, arrHash[i] );
                         if ( refBucket.size() < m_nProbesetThreshold ) {
                             refBucket.insert_after( arrPos[i].itPrev, pNode );
-                            cds::unref(f)( val );
+                            f( val );
                             ++m_ItemCounter;
                             m_Stat.onInsertSuccess();
                             return true;
@@ -2404,7 +2404,7 @@ namespace cds { namespace intrusive {
                         bucket_entry& refBucket = bucket( i, arrHash[i] );
                         if ( refBucket.size() < m_nProbesetSize ) {
                             refBucket.insert_after( arrPos[i].itPrev, pNode );
-                            cds::unref(f)( val );
+                            f( val );
                             ++m_ItemCounter;
                             nGoalTable = i;
                             assert( refBucket.size() > 1 );
@@ -2449,7 +2449,7 @@ namespace cds { namespace intrusive {
 
             The functor may change non-key fields of the \p item.
 
-            You may pass \p func argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You may pass \p func argument by reference using \p std::ref.
 
             Returns <tt> std::pair<bool, bool> </tt> where \p first is \p true if operation is successful,
             \p second is \p true if new item has been added or \p false if the item with \p key
@@ -2472,7 +2472,7 @@ namespace cds { namespace intrusive {
 
                     unsigned int nTable = contains( arrPos, arrHash, val, key_predicate() );
                     if ( nTable != c_nUndefTable ) {
-                        cds::unref(func)( false, *node_traits::to_value_ptr( *arrPos[nTable].itFound ), val );
+                        func( false, *node_traits::to_value_ptr( *arrPos[nTable].itFound ), val );
                         m_Stat.onEnsureExist();
                         return std::make_pair( true, false );
                     }
@@ -2484,7 +2484,7 @@ namespace cds { namespace intrusive {
                         bucket_entry& refBucket = bucket( i, arrHash[i] );
                         if ( refBucket.size() < m_nProbesetThreshold ) {
                             refBucket.insert_after( arrPos[i].itPrev, pNode );
-                            cds::unref(func)( true, val, val );
+                            func( true, val, val );
                             ++m_ItemCounter;
                             m_Stat.onEnsureSuccess();
                             return std::make_pair( true, true );
@@ -2495,7 +2495,7 @@ namespace cds { namespace intrusive {
                         bucket_entry& refBucket = bucket( i, arrHash[i] );
                         if ( refBucket.size() < m_nProbesetSize ) {
                             refBucket.insert_after( arrPos[i].itPrev, pNode );
-                            cds::unref(func)( true, val, val );
+                            func( true, val, val );
                             ++m_ItemCounter;
                             nGoalTable = i;
                             assert( refBucket.size() > 1 );
@@ -2629,7 +2629,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by reference using \p std::ref.
 
             The functor may change non-key fields of \p item.
 
@@ -2672,7 +2672,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by reference using \p std::ref.
 
             The functor may change non-key fields of \p item.
 
index bb181f9e248d3068404d9a604181b391c3649255..340d80276a78288d73470be62077024a7b7fdc8d 100644 (file)
@@ -3,10 +3,10 @@
 #ifndef __CDS_INTRUSIVE_DETAILS_LAZY_LIST_BASE_H
 #define __CDS_INTRUSIVE_DETAILS_LAZY_LIST_BASE_H
 
+#include <functional>   // ref
 #include <cds/intrusive/details/base.h>
 #include <cds/opt/compare.h>
 #include <cds/details/marked_ptr.h>
-#include <cds/ref.h>
 #include <cds/details/make_const_type.h>
 #include <boost/type_traits/is_same.hpp>
 #include <cds/lock/spinlock.h>
index 696b200a1065473c333548ea58014f4b6a5f698f..bd556f3a2f22f2cc6cae291608905b5cf62b901f 100644 (file)
@@ -4,11 +4,11 @@
 #define __CDS_INTRUSIVE_DETAILS_MICHAEL_LIST_BASE_H
 
 #include <type_traits>
+#include <functional>   // ref
 #include <cds/intrusive/details/base.h>
 #include <cds/opt/compare.h>
 #include <cds/cxx11_atomic.h>
 #include <cds/details/marked_ptr.h>
-#include <cds/ref.h>
 #include <cds/details/make_const_type.h>
 #include <cds/urcu/options.h>
 
index 5792f7f111d48c93e31fba9598db06ee19677f5f..2fb5a06b3d6b7d3ed50c19601df465887c901a3d 100644 (file)
@@ -3,12 +3,12 @@
 #ifndef __CDS_INTRUSIVE_DETAILS_MICHAEL_SET_BASE_H
 #define __CDS_INTRUSIVE_DETAILS_MICHAEL_SET_BASE_H
 
+#include <functional>   // ref
 #include <cds/intrusive/details/base.h>
 #include <cds/opt/compare.h>
 #include <cds/opt/hash.h>
 #include <cds/algo/bitop.h>
 #include <cds/cxx11_atomic.h>
-#include <cds/ref.h>
 
 namespace cds { namespace intrusive {
 
index e7029da4fbe286c564b6fe77694f92b326efb00f..abb9fa7049fb97bdcd8735a3e622695ecd657eb9 100644 (file)
@@ -4,9 +4,9 @@
 #define __CDS_INTRUSIVE_ELLEN_BINTREE_RCU_H
 
 #include <memory>
+#include <functional>   // ref
 #include <cds/intrusive/details/ellen_bintree_base.h>
 #include <cds/opt/compare.h>
-#include <cds/ref.h>
 #include <cds/details/binary_functor_wrapper.h>
 #include <cds/urcu/details/check_deadlock.h>
 #include <cds/urcu/exempt_ptr.h>
@@ -754,7 +754,7 @@ namespace cds { namespace intrusive {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this tree's item by concurrent threads.
             The user-defined functor is called only if the inserting is success and may be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref
 
             RCU \p synchronize method can be called. RCU should not be locked.
         */
@@ -785,7 +785,7 @@ namespace cds { namespace intrusive {
                             pNewInternal.reset( alloc_internal_node() );
 
                         if ( try_insert( val, pNewInternal.get(), res, updRetire )) {
-                            cds::unref(f)( val );
+                            f( val );
                             pNewInternal.release()  ;   // internal node is linked into the tree and should not be deleted
                             break;
                         }
@@ -821,7 +821,7 @@ namespace cds { namespace intrusive {
             The functor can 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 <tt>boost::ref</tt> or cds::ref.
+            You can pass \p func argument by value or by reference using \p std::ref.
 
             RCU \p synchronize method can be called. RCU should not be locked.
 
@@ -843,7 +843,7 @@ namespace cds { namespace intrusive {
                 search_result res;
                 for ( ;; ) {
                     if ( search( res, val, node_compare() )) {
-                        cds::unref(func)( false, *node_traits::to_value_ptr( res.pLeaf ), val );
+                        func( false, *node_traits::to_value_ptr( res.pLeaf ), val );
                         if ( pNewInternal.get() )
                             m_Stat.onInternalNodeDeleted() ;    // unique_internal_node_ptr deletes internal node
                         m_Stat.onEnsureExist();
@@ -857,7 +857,7 @@ namespace cds { namespace intrusive {
                             pNewInternal.reset( alloc_internal_node() );
 
                         if ( try_insert( val, pNewInternal.get(), res, updRetire )) {
-                            cds::unref(func)( true, val, val );
+                            func( true, val, val );
                             pNewInternal.release()  ;   // internal node is linked into the tree and should not be deleted
                             break;
                         }
@@ -1127,7 +1127,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -1172,7 +1172,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -1674,7 +1674,7 @@ namespace cds { namespace intrusive {
                             {
                                 if ( help_delete( pOp, updRetire )) {
                                     // res.pLeaf is not deleted yet since RCU is blocked
-                                    cds::unref(f)( *node_traits::to_value_ptr( res.pLeaf ));
+                                    f( *node_traits::to_value_ptr( res.pLeaf ));
                                     break;
                                 }
                                 pOp = nullptr;
@@ -1907,7 +1907,7 @@ namespace cds { namespace intrusive {
             search_result    res;
             if ( search( res, val, compare_functor() )) {
                 assert( res.pLeaf );
-                cds::unref(f)( *node_traits::to_value_ptr( res.pLeaf ), val );
+                f( *node_traits::to_value_ptr( res.pLeaf ), val );
 
                 m_Stat.onFindSuccess();
                 return true;
@@ -1924,7 +1924,7 @@ namespace cds { namespace intrusive {
             search_result    res;
             if ( search( res, key, node_compare() )) {
                 assert( res.pLeaf );
-                cds::unref(f)( *node_traits::to_value_ptr( res.pLeaf ), key );
+                f( *node_traits::to_value_ptr( res.pLeaf ), key );
 
                 m_Stat.onFindSuccess();
                 return true;
index 039114ffeb0f490576f284e06dea6271dfa4a71a..407b2e180e1f129607d3405a27d9350c2a1f6342 100644 (file)
@@ -4,9 +4,9 @@
 #define __CDS_INTRUSIVE_IMPL_ELLEN_BINTREE_H
 
 #include <memory>
+#include <functional>   // ref
 #include <cds/intrusive/details/ellen_bintree_base.h>
 #include <cds/opt/compare.h>
-#include <cds/ref.h>
 #include <cds/details/binary_functor_wrapper.h>
 #include <cds/urcu/details/check_deadlock.h>
 #include <cds/gc/guarded_ptr.h>
@@ -362,7 +362,7 @@ namespace cds { namespace intrusive {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this tree's item by concurrent threads.
             The user-defined functor is called only if the inserting is success and may be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref
         */
         template <typename Func>
         bool insert( value_type& val, Func f )
@@ -387,7 +387,7 @@ namespace cds { namespace intrusive {
                         pNewInternal.reset( alloc_internal_node() );
 
                     if ( try_insert( val, pNewInternal.get(), res )) {
-                        cds::unref(f)( val );
+                        f( val );
                         pNewInternal.release(); // internal node is linked into the tree and should not be deleted
                         break;
                     }
@@ -421,7 +421,7 @@ namespace cds { namespace intrusive {
             The functor can 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 <tt>boost::ref</tt> or cds::ref.
+            You can pass \p func argument by value or by reference using \p std::ref.
 
             Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
             \p second is \p true if new item has been added or \p false if the item with \p key
@@ -438,7 +438,7 @@ namespace cds { namespace intrusive {
             search_result res;
             for ( ;; ) {
                 if ( search( res, val, node_compare() )) {
-                    cds::unref(func)( false, *node_traits::to_value_ptr( res.pLeaf ), val );
+                    func( false, *node_traits::to_value_ptr( res.pLeaf ), val );
                     if ( pNewInternal.get() )
                         m_Stat.onInternalNodeDeleted() ;    // unique_internal_node_ptr deletes internal node
                     m_Stat.onEnsureExist();
@@ -451,7 +451,7 @@ namespace cds { namespace intrusive {
                         pNewInternal.reset( alloc_internal_node() );
 
                     if ( try_insert( val, pNewInternal.get(), res )) {
-                        cds::unref(func)( true, val, val );
+                        func( true, val, val );
                         pNewInternal.release()  ;   // internal node has been linked into the tree and should not be deleted
                         break;
                     }
@@ -703,7 +703,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -746,7 +746,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -1353,7 +1353,7 @@ namespace cds { namespace intrusive {
                         {
                             if ( help_delete( pOp )) {
                                 // res.pLeaf is not deleted yet since it is guarded
-                                cds::unref(f)( *node_traits::to_value_ptr( res.pLeaf ));
+                                f( *node_traits::to_value_ptr( res.pLeaf ));
                                 break;
                             }
                             pOp = nullptr;
@@ -1494,7 +1494,7 @@ namespace cds { namespace intrusive {
             search_result    res;
             if ( search( res, val, node_compare() )) {
                 assert( res.pLeaf );
-                cds::unref(f)( *node_traits::to_value_ptr( res.pLeaf ), val );
+                f( *node_traits::to_value_ptr( res.pLeaf ), val );
 
                 m_Stat.onFindSuccess();
                 return true;
@@ -1517,7 +1517,7 @@ namespace cds { namespace intrusive {
             search_result    res;
             if ( search( res, val, compare_functor() )) {
                 assert( res.pLeaf );
-                cds::unref(f)( *node_traits::to_value_ptr( res.pLeaf ), val );
+                f( *node_traits::to_value_ptr( res.pLeaf ), val );
 
                 m_Stat.onFindSuccess();
                 return true;
index 943232d676c45618faeec693faa38b6e38f7b3d8..c0d64a96baa0425ced5454a27c561675680a246a 100644 (file)
@@ -563,7 +563,7 @@ namespace cds { namespace intrusive {
             where \p val is the item inserted.
             While the functor \p f is working the item \p val is locked.
             The user-defined functor is called only if the inserting is success and may be passed by reference
-            using <tt>boost::ref</tt>.
+            using \p std::ref
         */
         template <typename Func>
         bool insert( value_type& val, Func f )
@@ -591,7 +591,7 @@ namespace cds { namespace intrusive {
             The functor may change non-key fields of the \p item.
             While the functor \p f is working the item \p item is locked.
 
-            You may pass \p func argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You may pass \p func argument by reference using \p std::ref.
 
             Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
             \p second is \p true if new item has been added or \p false if the item with \p key
@@ -738,7 +738,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item.
             While the functor \p f is calling the item \p item is locked.
@@ -778,7 +778,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the \p find function argument.
 
-            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 non-key fields of \p item.
             While the functor \p f is calling the item \p item is locked.
@@ -985,7 +985,7 @@ namespace cds { namespace intrusive {
                         }
                         else {
                             link_node( node_traits::to_node_ptr( val ), pos.pPred, pos.pCur );
-                            cds::unref(f)( val );
+                            f( val );
                             ++m_ItemCounter;
                             return true;
                         }
@@ -1008,7 +1008,7 @@ namespace cds { namespace intrusive {
                         if ( pos.pCur != tail() && cmp( *node_traits::to_value_ptr( *pos.pCur ), val ) == 0 ) {
                             // key already in the list
 
-                            cds::unref(func)( false, *node_traits::to_value_ptr( *pos.pCur ) , val );
+                            func( false, *node_traits::to_value_ptr( *pos.pCur ) , val );
                             return std::make_pair( true, false );
                         }
                         else {
@@ -1016,7 +1016,7 @@ namespace cds { namespace intrusive {
                             link_checker::is_empty( node_traits::to_node_ptr( val ) );
 
                             link_node( node_traits::to_node_ptr( val ), pos.pPred, pos.pCur );
-                            cds::unref(func)( true, val, val );
+                            func( true, val, val );
                             ++m_ItemCounter;
                             return std::make_pair( true, true );
                         }
@@ -1074,7 +1074,7 @@ namespace cds { namespace intrusive {
                             if ( pos.pCur != tail() && cmp( *node_traits::to_value_ptr( *pos.pCur ), val ) == 0 ) {
                                 // key found
                                 unlink_node( pos.pPred, pos.pCur, pHead );
-                                cds::unref(f)( *node_traits::to_value_ptr( *pos.pCur ) );
+                                f( *node_traits::to_value_ptr( *pos.pCur ) );
                                 --m_ItemCounter;
                                 nResult = 1;
                             }
@@ -1130,7 +1130,7 @@ namespace cds { namespace intrusive {
                 if ( !pos.pCur->is_marked()
                     && cmp( *node_traits::to_value_ptr( *pos.pCur ), val ) == 0 )
                 {
-                    cds::unref(f)( *node_traits::to_value_ptr( *pos.pCur ), val );
+                    f( *node_traits::to_value_ptr( *pos.pCur ), val );
                     return true;
                 }
             }
index da5fba5351b7a6a9f784fccfef30b1f0151e81f1..43addd16914e558113ee53b705d84f350f08eada 100644 (file)
@@ -536,7 +536,7 @@ namespace cds { namespace intrusive {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this list's item by concurrent threads.
             The user-defined functor is called only if the inserting is success and may be passed by reference
-            using <tt>boost::ref</tt>.
+            using \p std::ref
         */
         template <typename Func>
         bool insert( value_type& val, Func f )
@@ -564,7 +564,7 @@ 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 may pass \p func argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You may pass \p func argument by reference using \p std::ref.
 
             Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
             \p second is \p true if new item has been added or \p false if the item with \p key
@@ -710,7 +710,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the function is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -752,7 +752,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item. Note that the function is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -948,7 +948,7 @@ namespace cds { namespace intrusive {
                 typename gc::Guard guard;
                 guard.assign( &val );
                 if ( link_node( pNode, pos ) ) {
-                    cds::unref(f)( val );
+                    f( val );
                     ++m_ItemCounter;
                     return true;
                 }
@@ -972,7 +972,7 @@ namespace cds { namespace intrusive {
                     }
                     assert( key_comparator()( val, *node_traits::to_value_ptr( *pos.pCur ) ) == 0 );
 
-                    unref(func)( false, *node_traits::to_value_ptr( *pos.pCur ) , val );
+                    func( false, *node_traits::to_value_ptr( *pos.pCur ) , val );
                     return std::make_pair( true, false );
                 }
                 else {
@@ -980,7 +980,7 @@ namespace cds { namespace intrusive {
                     guard.assign( &val );
                     if ( link_node( pNode, pos ) ) {
                         ++m_ItemCounter;
-                        unref(func)( true, val, val );
+                        func( true, val, val );
                         return std::make_pair( true, true );
                     }
                     // clear next field
@@ -1015,7 +1015,7 @@ namespace cds { namespace intrusive {
             back_off bkoff;
             while ( search( refHead, val, pos, cmp )) {
                 if ( unlink_node( pos ) ) {
-                    cds::unref(f)( *node_traits::to_value_ptr( *pos.pCur ) );
+                    f( *node_traits::to_value_ptr( *pos.pCur ) );
                     --m_ItemCounter;
                     return true;
                 }
@@ -1068,7 +1068,7 @@ namespace cds { namespace intrusive {
         {
             position pos;
             if ( search( refHead, val, pos, cmp )) {
-                cds::unref(f)( *node_traits::to_value_ptr( *pos.pCur ), val );
+                f( *node_traits::to_value_ptr( *pos.pCur ), val );
                 return true;
             }
             return false;
index de43a010ce270f4e043afd6d884e3950236455d1..c9f25594536889144c05952a9e76b313017c5638 100644 (file)
@@ -5,9 +5,9 @@
 
 #include <type_traits>
 #include <memory>
+#include <functional>   // ref
 #include <cds/intrusive/details/skip_list_base.h>
 #include <cds/opt/compare.h>
-#include <cds/ref.h>
 #include <cds/details/binary_functor_wrapper.h>
 #include <cds/gc/guarded_ptr.h>
 
@@ -654,7 +654,7 @@ namespace cds { namespace intrusive {
                 if ( !pos.pPrev[0]->next(0).compare_exchange_strong( p, marked_node_ptr(pNode), memory_model::memory_order_release, atomics::memory_order_relaxed ) ) {
                     return false;
                 }
-                cds::unref( f )( val );
+                f( val );
             }
 
             for ( unsigned int nLevel = 1; nLevel < nHeight; ++nLevel ) {
@@ -710,7 +710,7 @@ namespace cds { namespace intrusive {
                 if ( pDel->next(0).compare_exchange_strong( p, marked_node_ptr(p.ptr(), 1),
                      memory_model::memory_order_acquire, atomics::memory_order_relaxed ))
                 {
-                    cds::unref(f)( *node_traits::to_value_ptr( pDel ));
+                    f( *node_traits::to_value_ptr( pDel ));
 
                     // Physical deletion
                     // try fast erase
@@ -786,7 +786,7 @@ namespace cds { namespace intrusive {
                         }
                         else if ( nCmp == 0 ) {
                             // found
-                            cds::unref(f)( *node_traits::to_value_ptr( pCur.ptr() ), val );
+                            f( *node_traits::to_value_ptr( pCur.ptr() ), val );
                             return find_fastpath_found;
                         }
                         else // pCur > val - go down
@@ -805,7 +805,7 @@ namespace cds { namespace intrusive {
             if ( find_position( val, pos, cmp, true )) {
                 assert( cmp( *node_traits::to_value_ptr( pos.pCur ), val ) == 0 );
 
-                cds::unref(f)( *node_traits::to_value_ptr( pos.pCur ), val );
+                f( *node_traits::to_value_ptr( pos.pCur ), val );
                 return true;
             }
             else
@@ -1053,7 +1053,7 @@ namespace cds { namespace intrusive {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
             The user-defined functor is called only if the inserting is success and may be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref
         */
         template <typename Func>
         bool insert( value_type& val, Func f )
@@ -1121,7 +1121,7 @@ namespace cds { namespace intrusive {
             The functor can 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 <tt>boost::ref</tt> or cds::ref.
+            You can pass \p func argument by value or by reference using \p std::ref.
 
             Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
             \p second is \p true if new item has been added or \p false if the item with \p key
@@ -1148,7 +1148,7 @@ namespace cds { namespace intrusive {
                     if ( !bTowerMade )
                         scp.release();
 
-                    cds::unref(func)( false, *node_traits::to_value_ptr(pos.pCur), val );
+                    func( false, *node_traits::to_value_ptr(pos.pCur), val );
                     m_Stat.onEnsureExist();
                     return std::make_pair( true, false );
                 }
@@ -1160,7 +1160,7 @@ namespace cds { namespace intrusive {
                         bTowerOk = true;
                 }
 
-                if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { cds::unref(func)( true, item, item ); })) {
+                if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { func( true, item, item ); })) {
                     m_Stat.onInsertRetry();
                     continue;
                 }
@@ -1415,7 +1415,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -1462,7 +1462,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
index c1c40a38dfef87c31bac4004e1ab627827fc42f1..a50e742a5608b183505f1e6a761caf87c6c12b71 100644 (file)
@@ -159,7 +159,7 @@ namespace cds { namespace intrusive {
         void dispose_node( node_type * pNode, Disposer disp )
         {
             clear_links( pNode );
-            cds::unref(disp)( node_traits::to_value_ptr( *pNode ));
+            disp( node_traits::to_value_ptr( *pNode ));
         }
 
         template <class Disposer>
@@ -354,7 +354,7 @@ namespace cds { namespace intrusive {
             The functor may change non-key fields of the \p item.
             While the functor \p f is calling the item \p item is locked.
 
-            You may pass \p func argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You may pass \p func argument 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
@@ -379,7 +379,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item.
             While the functor \p f is calling the item found \p item is locked.
@@ -404,7 +404,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item.
             While the functor \p f is calling the item found \p item is locked.
@@ -581,7 +581,7 @@ namespace cds { namespace intrusive {
                         if ( pos.pCur != &m_Tail && cmp( *node_traits::to_value_ptr( *pos.pCur ), val ) == 0 ) {
                             // key already in the list
 
-                            cds::unref(func)( false, *node_traits::to_value_ptr( *pos.pCur ) , val );
+                            func( false, *node_traits::to_value_ptr( *pos.pCur ) , val );
                             return std::make_pair( iterator( pos.pCur ), false );
                         }
                         else {
@@ -589,7 +589,7 @@ namespace cds { namespace intrusive {
                             link_checker::is_empty( node_traits::to_node_ptr( val ) );
 
                             link_node( node_traits::to_node_ptr( val ), pos.pPred, pos.pCur );
-                            cds::unref(func)( true, val, val );
+                            func( true, val, val );
                             ++m_ItemCounter;
                             return std::make_pair( iterator( node_traits::to_node_ptr( val )), true );
                         }
@@ -615,7 +615,7 @@ namespace cds { namespace intrusive {
                 cds::lock::scoped_lock< typename node_type::lock_type> al( pos.pCur->m_Lock );
                 if ( cmp( *node_traits::to_value_ptr( *pos.pCur ), val ) == 0 )
                 {
-                    cds::unref(f)( *node_traits::to_value_ptr( *pos.pCur ), val );
+                    f( *node_traits::to_value_ptr( *pos.pCur ), val );
                     return true;
                 }
             }
index c20ccda4eacd35e61c46dc543792eadbb8c9c85a..43ddce46c2239824115fa5c7398143825108b891 100644 (file)
@@ -444,7 +444,7 @@ namespace cds { namespace intrusive {
             where \p val is the item inserted.
             While the functor \p f is working the item \p val is locked.
             The user-defined functor is called only if the inserting is success and may be passed by reference
-            using <tt>boost::ref</tt>.
+            using \p std::ref.
         */
         template <typename Func>
         bool insert( value_type& val, Func f )
@@ -474,7 +474,7 @@ namespace cds { namespace intrusive {
             The functor may change non-key fields of the \p item.
             While the functor \p f is calling the item \p item is locked.
 
-            You may pass \p func argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You may pass \p func argument 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
@@ -658,7 +658,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item.
             While the functor \p f is calling the item found \p item is locked.
@@ -696,7 +696,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            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 non-key fields of \p item.
             While the functor \p f is calling the item found \p item is locked.
@@ -917,7 +917,7 @@ namespace cds { namespace intrusive {
                         }
                         else {
                             link_node( node_traits::to_node_ptr( val ), pos.pPred, pos.pCur );
-                            cds::unref(f)( val );
+                            f( val );
                             ++m_ItemCounter;
                             return true;
                         }
@@ -950,7 +950,7 @@ namespace cds { namespace intrusive {
                         if ( pos.pCur != &m_Tail && cmp( *node_traits::to_value_ptr( *pos.pCur ), val ) == 0 ) {
                             // key already in the list
 
-                            cds::unref(func)( false, *node_traits::to_value_ptr( *pos.pCur ) , val );
+                            func( false, *node_traits::to_value_ptr( *pos.pCur ) , val );
                             return std::make_pair( iterator( pos.pCur ), false );
                         }
                         else {
@@ -958,7 +958,7 @@ namespace cds { namespace intrusive {
                             link_checker::is_empty( node_traits::to_node_ptr( val ) );
 
                             link_node( node_traits::to_node_ptr( val ), pos.pPred, pos.pCur );
-                            cds::unref(func)( true, val, val );
+                            func( true, val, val );
                             ++m_ItemCounter;
                             return std::make_pair( iterator( node_traits::to_node_ptr( val )), true );
                         }
@@ -1030,7 +1030,7 @@ namespace cds { namespace intrusive {
                             if ( pos.pCur != &m_Tail && cmp( *node_traits::to_value_ptr( *pos.pCur ), val ) == 0 ) {
                                 // key found
                                 unlink_node( pos.pPred, pos.pCur, pHead );
-                                cds::unref(f)( *node_traits::to_value_ptr( *pos.pCur ) );
+                                f( *node_traits::to_value_ptr( *pos.pCur ) );
                                 --m_ItemCounter;
                                 nResult = 1;
                             }
@@ -1108,7 +1108,7 @@ namespace cds { namespace intrusive {
                 cds::lock::scoped_lock< typename node_type::lock_type> al( pos.pCur->m_Lock );
                 if ( cmp( *node_traits::to_value_ptr( *pos.pCur ), val ) == 0 )
                 {
-                    cds::unref(f)( *node_traits::to_value_ptr( *pos.pCur ), val );
+                    f( *node_traits::to_value_ptr( *pos.pCur ), val );
                     return true;
                 }
             }
index 6f0ace51cfc0bf49aa04238bcb9eda3fe3d37a72..89a5ae6b78f29141a073e70e252974688efb8ded 100644 (file)
@@ -106,7 +106,7 @@ namespace cds { namespace intrusive {
         void dispose_node( node_type * pNode, Disposer disp )
         {
             clear_links( pNode );
-            cds::unref(disp)( node_traits::to_value_ptr( *pNode ));
+            disp( node_traits::to_value_ptr( *pNode ));
         }
 
         template <class Disposer>
@@ -316,7 +316,7 @@ 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 <tt>boost::ref</tt> or cds::ref.
+            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
@@ -341,7 +341,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item.
             The function \p find does not serialize simultaneous access to the list \p item. If such access is
@@ -380,7 +380,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item.
             The function \p find does not serialize simultaneous access to the list \p item. If such access is
@@ -530,7 +530,7 @@ namespace cds { namespace intrusive {
                 if ( search( refHead, val, key_comparator(), pos ) ) {
                     assert( key_comparator()( val, *node_traits::to_value_ptr( *pos.pCur ) ) == 0 );
 
-                    unref(func)( false, *node_traits::to_value_ptr( *pos.pCur ) , val );
+                    func( false, *node_traits::to_value_ptr( *pos.pCur ) , val );
                     return std::make_pair( iterator( pos.pCur ), false );
                 }
                 else {
@@ -538,7 +538,7 @@ namespace cds { namespace intrusive {
 
                     if ( link_node( node_traits::to_node_ptr( val ), pos ) ) {
                         ++m_ItemCounter;
-                        unref(func)( true, val , val );
+                        func( true, val , val );
                         return std::make_pair( iterator( node_traits::to_node_ptr( val )), true );
                     }
                 }
@@ -559,7 +559,7 @@ namespace cds { namespace intrusive {
 
             if ( search( refHead, val, cmp, pos ) ) {
                 assert( pos.pCur != nullptr );
-                unref(f)( *node_traits::to_value_ptr( *pos.pCur ), val );
+                f( *node_traits::to_value_ptr( *pos.pCur ), val );
                 return true;
             }
             return false;
index f57f81723cbfee4e780fe8ffe3a0979ec9ecdfae..69ab9ceefe27482211590774156d836f430ff322 100644 (file)
@@ -342,7 +342,7 @@ namespace cds { namespace intrusive {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this list's item by concurrent threads.
             The user-defined functor is called only if the inserting is success and may be passed by reference
-            using <tt>boost::ref</tt>.
+            using \p std::ref.
 
             The function makes RCU lock internally.
         */
@@ -374,7 +374,7 @@ 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 <tt>boost::ref</tt> or cds::ref.
+            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
@@ -559,7 +559,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item.
             The function \p find does not serialize simultaneous access to the list \p item. If such access is
@@ -600,7 +600,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item.
             The function \p find does not serialize simultaneous access to the list \p item. If such access is
@@ -806,7 +806,7 @@ namespace cds { namespace intrusive {
                     return false;
 
                 if ( link_node( node_traits::to_node_ptr( val ), pos ) ) {
-                    cds::unref(f)( val );
+                    f( val );
                     ++m_ItemCounter;
                     return true;
                 }
@@ -834,7 +834,7 @@ namespace cds { namespace intrusive {
                 if ( search( refHead, val, pos, key_comparator() ) ) {
                     assert( key_comparator()( val, *node_traits::to_value_ptr( *pos.pCur ) ) == 0 );
 
-                    unref(func)( false, *node_traits::to_value_ptr( *pos.pCur ), val );
+                    func( false, *node_traits::to_value_ptr( *pos.pCur ), val );
                     return std::make_pair( iterator( pos.pCur ), false );
                 }
                 else {
@@ -842,7 +842,7 @@ namespace cds { namespace intrusive {
 
                     if ( link_node( node_traits::to_node_ptr( val ), pos ) ) {
                         ++m_ItemCounter;
-                        unref(func)( true, val , val );
+                        func( true, val , val );
                         return std::make_pair( iterator( node_traits::to_node_ptr( val )), true );
                     }
 
@@ -900,7 +900,7 @@ namespace cds { namespace intrusive {
                     }
                 }
 
-                cds::unref(f)( *node_traits::to_value_ptr( *pos.pCur ) );
+                f( *node_traits::to_value_ptr( *pos.pCur ) );
                 --m_ItemCounter;
                 dispose_node( pos.pCur );
                 return true;
@@ -949,7 +949,7 @@ namespace cds { namespace intrusive {
             rcu_lock l( bLock );
             if ( search( refHead, val, pos, cmp ) ) {
                 assert( pos.pCur != nullptr );
-                unref(f)( *node_traits::to_value_ptr( *pos.pCur ), val );
+                f( *node_traits::to_value_ptr( *pos.pCur ), val );
                 return true;
             }
             return false;
index d6242b76c4db1a9517ab91c7d8d94e56bd15012f..51ebeeb9170adf696a33f68771ba20c77291ae46 100644 (file)
@@ -400,7 +400,7 @@ namespace cds { namespace intrusive {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
             The user-defined functor is called only if the inserting is success and can be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref.
         */
         template <typename Func>
         bool insert( value_type& val, Func f )
@@ -431,7 +431,7 @@ 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 may pass \p func argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You may pass \p func argument by reference using \p std::ref.
 
             Returns <tt> std::pair<bool, bool> </tt> where \p first is \p true if operation is successfull,
             \p second is \p true if new item has been added or \p false if the item with \p key
@@ -609,7 +609,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You can 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.
@@ -654,7 +654,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You can 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.
index 59b542dbacca0e85681bd1926c63d1a725d4b035..52120fafc788a99ff31b3c2045dc28fdbd8afc33 100644 (file)
@@ -206,7 +206,7 @@ namespace cds { namespace intrusive {
             The functor can 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 <tt>boost::ref</tt> or cds::ref.
+            You can pass \p func argument by value or by reference using \p std::ref.
 
             Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
             \p second is \p true if new item has been added or \p false if the item with \p key
@@ -259,7 +259,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item.
             The functor does not serialize simultaneous access to the set \p item. If such access is
@@ -303,7 +303,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item.
             The functor does not serialize simultaneous access to the set \p item. If such access is
index 7c2c80cca3331cbf2067fd707c75d08b0a487663..18fe794f287337d854106b9be03a214e4d542ff0 100644 (file)
@@ -259,7 +259,7 @@ namespace cds { namespace intrusive {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
             The user-defined functor is called only if the inserting is success and can be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref.
         */
         template <typename Func>
         bool insert( value_type& val, Func f )
@@ -290,7 +290,7 @@ namespace cds { namespace intrusive {
             The functor can 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 <tt>boost::ref</tt> or cds::ref.
+            You can pass \p func argument by value or by reference using \p std::ref.
 
             Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
             \p second is \p true if new item has been added or \p false if the item with \p key
@@ -506,7 +506,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item.
             The functor does not serialize simultaneous access to the set \p item. If such access is
@@ -550,7 +550,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item.
             The functor does not serialize simultaneous access to the set \p item. If such access is
index ffe3adb27c8c127d61ac00a8c764e55b504c60f0..29cca936b37709086900661cf656ad4bda819f0d 100644 (file)
@@ -3,6 +3,7 @@
 #ifndef __CDS_INTRUSIVE_MSPRIORITY_QUEUE_H
 #define __CDS_INTRUSIVE_MSPRIORITY_QUEUE_H
 
+#include <functional>   // ref
 #include <cds/intrusive/details/base.h>
 #include <cds/lock/spinlock.h>
 #include <cds/os/thread.h>
@@ -11,7 +12,6 @@
 #include <cds/opt/buffer.h>
 #include <cds/opt/compare.h>
 #include <cds/details/bounded_container.h>
-#include <cds/ref.h>
 
 namespace cds { namespace intrusive {
 
@@ -353,7 +353,7 @@ namespace cds { namespace intrusive {
             while ( !empty() ) {
                 value_type * pVal = pop();
                 if ( pVal )
-                    cds::unref(f)( *pVal );
+                    f( *pVal );
             }
         }
 
index d22c7a6a5dbe27513c25318f1c465b8fe4caa66c..cba41218c80e7de110ea7ef06029754406559138 100644 (file)
@@ -4,12 +4,12 @@
 #define __CDS_INTRUSIVE_OPTIMISTIC_QUEUE_H
 
 #include <type_traits>
+#include <functional>   // ref
 #include <cds/intrusive/details/base.h>
 #include <cds/cxx11_atomic.h>
 #include <cds/gc/default_gc.h>
 #include <cds/gc/hrc/gc_fwd.h>
 #include <cds/intrusive/details/queue_stat.h>
-#include <cds/ref.h>
 
 namespace cds { namespace intrusive {
 
index cb1ca410a0a76b1e809aba916292eb2a97adfb3d..ba4ce74658afdbbc7718b9d42e239e6120dd8522 100644 (file)
@@ -5,10 +5,10 @@
 
 #include <type_traits>
 #include <memory>
+#include <functional>   // ref
 #include <cds/gc/nogc.h>
 #include <cds/intrusive/details/skip_list_base.h>
 #include <cds/opt/compare.h>
-#include <cds/ref.h>
 #include <cds/details/binary_functor_wrapper.h>
 
 namespace cds { namespace intrusive {
@@ -534,7 +534,7 @@ namespace cds { namespace intrusive {
                 if ( !pos.pPrev[0]->next(0).compare_exchange_strong( p, pNode, memory_model::memory_order_release, memory_model::memory_order_relaxed ) ) {
                     return false;
                 }
-                cds::unref( f )( val );
+                f( val );
             }
 
             for ( unsigned int nLevel = 1; nLevel < nHeight; ++nLevel ) {
@@ -562,7 +562,7 @@ namespace cds { namespace intrusive {
             if ( find_position( val, pos, cmp, true, false )) {
                 assert( cmp( *node_traits::to_value_ptr( pos.pCur ), val ) == 0 );
 
-                cds::unref(f)( *node_traits::to_value_ptr( pos.pCur ), val );
+                f( *node_traits::to_value_ptr( pos.pCur ), val );
 
                 m_Stat.onFindFastSuccess();
                 return pos.pCur;
@@ -723,7 +723,7 @@ namespace cds { namespace intrusive {
             The functor can 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 <tt>boost::ref</tt> or cds::ref.
+            You can pass \p func argument by value or by reference using \p std::ref.
 
             Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
             \p second is \p true if new item has been added or \p false if the item with \p key
@@ -747,7 +747,7 @@ namespace cds { namespace intrusive {
                     if ( !bTowerMade )
                         scp.release();
 
-                    cds::unref(func)( false, *node_traits::to_value_ptr(pos.pCur), val );
+                    func( false, *node_traits::to_value_ptr(pos.pCur), val );
                     m_Stat.onEnsureExist();
                     return std::make_pair( true, false );
                 }
@@ -759,7 +759,7 @@ namespace cds { namespace intrusive {
                         bTowerOk = true;
                 }
 
-                if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { cds::unref(func)( true, item, item ); })) {
+                if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { func( true, item, item ); })) {
                     m_Stat.onInsertRetry();
                     continue;
                 }
@@ -784,7 +784,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -829,7 +829,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
index 314d1700cbb767c285c560ead10222b92518f040..e5d17ee82923d526ee1222d581d7867b508dd89d 100644 (file)
@@ -5,9 +5,9 @@
 
 #include <type_traits>
 #include <memory>
+#include <functional>   // ref
 #include <cds/intrusive/details/skip_list_base.h>
 #include <cds/opt/compare.h>
-#include <cds/ref.h>
 #include <cds/urcu/details/check_deadlock.h>
 #include <cds/details/binary_functor_wrapper.h>
 #include <cds/urcu/exempt_ptr.h>
@@ -879,7 +879,7 @@ retry:
 #       ifdef _DEBUG
                 pNode->m_bLinked = true;
 #       endif
-                cds::unref( f )( val );
+                f( val );
             }
 
             for ( unsigned int nLevel = 1; nLevel < nHeight; ++nLevel ) {
@@ -945,7 +945,7 @@ retry:
                 int const nMask = bExtract ? 3 : 1;
                 if ( pDel->next(0).compare_exchange_strong( pSucc, pSucc | nMask, memory_model::memory_order_acquire, atomics::memory_order_relaxed ))
                 {
-                    cds::unref(f)( *node_traits::to_value_ptr( pDel ));
+                    f( *node_traits::to_value_ptr( pDel ));
 
                     // physical deletion
                     // try fast erase
@@ -1031,7 +1031,7 @@ retry:
                         }
                         else if ( nCmp == 0 ) {
                             // found
-                            cds::unref(f)( *node_traits::to_value_ptr( pCur.ptr() ), val );
+                            f( *node_traits::to_value_ptr( pCur.ptr() ), val );
                             return find_fastpath_found;
                         }
                         else // pCur > val - go down
@@ -1049,7 +1049,7 @@ retry:
             if ( find_position( val, pos, cmp, true )) {
                 assert( cmp( *node_traits::to_value_ptr( pos.pCur ), val ) == 0 );
 
-                cds::unref(f)( *node_traits::to_value_ptr( pos.pCur ), val );
+                f( *node_traits::to_value_ptr( pos.pCur ), val );
                 return true;
             }
             else
@@ -1470,7 +1470,7 @@ retry:
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
             The user-defined functor is called only if the inserting is success and may be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref.
 
             RCU \p synchronize method can be called. RCU should not be locked.
         */
@@ -1551,7 +1551,7 @@ retry:
             The functor can 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 <tt>boost::ref</tt> or cds::ref.
+            You can pass \p func argument by value or by reference using \p std::ref.
 
             RCU \p synchronize method can be called. RCU should not be locked.
 
@@ -1583,7 +1583,7 @@ retry:
                         if ( !bTowerMade )
                             scp.release();
 
-                        cds::unref(func)( false, *node_traits::to_value_ptr(pos.pCur), val );
+                        func( false, *node_traits::to_value_ptr(pos.pCur), val );
                         m_Stat.onEnsureExist();
                         break;
                     }
@@ -1595,7 +1595,7 @@ retry:
                             bTowerOk = true;
                     }
 
-                    if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { cds::unref(func)( true, item, item ); })) {
+                    if ( !insert_at_position( val, pNode, pos, [&func]( value_type& item ) { func( true, item, item ); })) {
                         m_Stat.onInsertRetry();
                         continue;
                     }
@@ -1869,7 +1869,7 @@ retry:
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -1913,7 +1913,7 @@ retry:
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
index 2f80baa3111568c31c5e65c24ac357302ef92db2..acab1ea388f0765eb6a9d90f92a29e2d21dd6c6c 100644 (file)
@@ -465,7 +465,7 @@ namespace cds { namespace intrusive {
             assert( pHead != nullptr );
 
             return m_List.find_at( pHead, sv, cmp,
-                [&f](value_type& item, split_list::details::search_value_type<Q>& val){ cds::unref(f)(item, val.val ); });
+                [&f](value_type& item, split_list::details::search_value_type<Q>& val){ f(item, val.val ); });
         }
 
         template <typename Q, typename Compare>
@@ -624,7 +624,7 @@ namespace cds { namespace intrusive {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
             The user-defined functor is called only if the inserting is success and may be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref.
         */
         template <typename Func>
         bool insert( value_type& val, Func f )
@@ -662,7 +662,7 @@ namespace cds { namespace intrusive {
             The functor can 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 <tt>boost::ref</tt> or cds::ref.
+            You can pass \p func argument by value or by reference using \p std::ref.
 
             Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
             \p second is \p true if new item has been added or \p false if the item with \p key
@@ -838,7 +838,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -883,7 +883,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
index a8550803122464bb5be16c3070974309111bec70..a6f47f13a79fdecdf46c1adbe34077d8ce734f80 100644 (file)
@@ -311,7 +311,7 @@ namespace cds { namespace intrusive {
             The functor can 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 by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p func argument by value by reference using \p std::ref.
 
             Returns std::pair<bool, bool> where \p first is \p true if operation is successfull,
             \p second is \p true if new item has been added or \p false if the item with given key
@@ -368,7 +368,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item.
             The functor does not serialize simultaneous access to the set \p item. If such access is
@@ -412,7 +412,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item.
             The functor does not serialize simultaneous access to the set \p item. If such access is
@@ -608,7 +608,7 @@ namespace cds { namespace intrusive {
             dummy_node_type * pHead = get_bucket( nHash );
             assert( pHead != nullptr );
             return m_List.find_at( pHead, sv, cmp,
-                [&f](value_type& item, split_list::details::search_value_type<Q>& val){ cds::unref(f)(item, val.val ); });
+                [&f](value_type& item, split_list::details::search_value_type<Q>& val){ f(item, val.val ); });
         }
 
         //@endcond
index 315d5559597bd0196e7f1cdf0265c740ff17767c..1faf970e6e51756ecc2a4a224dc5cab6985a77e3 100644 (file)
@@ -354,7 +354,7 @@ namespace cds { namespace intrusive {
             assert( pHead != nullptr );
 
             return m_List.find_at( pHead, sv, cmp,
-                [&f](value_type& item, split_list::details::search_value_type<Q>& val){ cds::unref(f)(item, val.val ); });
+                [&f](value_type& item, split_list::details::search_value_type<Q>& val){ f(item, val.val ); });
         }
 
         template <typename Q, typename Compare>
@@ -496,7 +496,7 @@ namespace cds { namespace intrusive {
             where \p val is the item inserted. User-defined functor \p f should guarantee that during changing
             \p val no any other changes could be made on this set's item by concurrent threads.
             The user-defined functor is called only if the inserting is success and may be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref.
 
             The function makes RCU lock internally.
         */
@@ -536,7 +536,7 @@ namespace cds { namespace intrusive {
             The functor can 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 <tt>boost::ref</tt> or cds::ref.
+            You can pass \p func argument by value or by reference using \p std::ref.
 
             The function makes RCU lock internally.
 
@@ -739,7 +739,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
@@ -786,7 +786,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by value or by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by value or by reference using \p std::ref.
 
             The functor can change non-key fields of \p item. Note that the functor is only guarantee
             that \p item cannot be disposed during functor is executing.
index 61feae6fdd75e1ea8fcf16770f4da044c3e6d55d..4f799d3de62e6b6f7a7246e153a90f0c90a30f28 100644 (file)
@@ -488,7 +488,7 @@ namespace cds { namespace intrusive {
             where \p val is the item inserted.
 
             The user-defined functor is called only if the inserting is success and can be passed by reference
-            using <tt>boost::ref</tt>
+            using \p std::ref.
         */
         template <typename Func>
         bool insert( value_type& val, Func f )
@@ -528,7 +528,7 @@ namespace cds { namespace intrusive {
 
             The functor may change non-key fields of the \p item.
 
-            You may pass \p func argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You may pass \p func argument by reference using \p std::ref.
 
             Returns <tt> std::pair<bool, bool> </tt> where \p first is \p true if operation is successful,
             \p second is \p true if new item has been added or \p false if the item with \p key
@@ -671,7 +671,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by reference using \p std::ref.
 
             The functor may change non-key fields of \p item.
 
@@ -713,7 +713,7 @@ namespace cds { namespace intrusive {
             \endcode
             where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-            You can pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+            You can pass \p f argument by reference using \p std::ref.
 
             The functor may change non-key fields of \p item.
 
index 8d95114bbd1ef32f8826764fe0a264979206bec0..fa18554f57b7fc2749c92de7ac77f7fb3ebe1206 100644 (file)
@@ -3,11 +3,11 @@
 #ifndef __CDS_INTRUSIVE_STRIPED_SET_ADAPTER_H
 #define __CDS_INTRUSIVE_STRIPED_SET_ADAPTER_H
 
+#include <functional>   // ref
 #include <cds/opt/options.h>
 #include <cds/intrusive/striped_set/resizing_policy.h>
 #include <cds/opt/hash.h>
 #include <cds/opt/compare.h>    // cds::opt::details::make_comparator - for some adapt specializations
-#include <cds/ref.h>
 
 namespace cds { namespace intrusive {
 
@@ -48,7 +48,7 @@ namespace cds { namespace intrusive {
                 where \p item is the item inserted.
 
                 The user-defined functor \p f is called only if the inserting is success. It can be passed by reference
-                using <tt>boost::ref</tt>
+                using \p std::ref
                 <hr>
 
             <b>Ensures that the \p item exists in the container</b>
@@ -79,7 +79,7 @@ namespace cds { namespace intrusive {
 
                 The functor can change non-key fields of the \p item.
 
-                You can pass \p f argument by reference using <tt>boost::ref</tt>.
+                You can pass \p f argument 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 val key
@@ -125,7 +125,7 @@ namespace cds { namespace intrusive {
                 \endcode
                 where \p item is the item found, \p val is the <tt>find</tt> function argument.
 
-                You can pass \p f argument by reference using <tt>boost::ref</tt> or cds::ref.
+                You can pass \p f argument by reference using \p std::ref.
 
                 The functor can change non-key fields of \p item.
                 The \p val argument may be non-const since it can be used as \p f functor destination i.e., the functor
@@ -222,7 +222,7 @@ namespace cds { namespace intrusive {
                 {
                     std::pair<iterator, bool> res = m_Set.insert( val );
                     if ( res.second )
-                        cds::unref(f)( val );
+                        f( val );
                     return res.second;
                 }
 
@@ -230,7 +230,7 @@ namespace cds { namespace intrusive {
                 std::pair<bool, bool> ensure( value_type& val, Func f )
                 {
                     std::pair<iterator, bool> res = m_Set.insert( val );
-                    cds::unref(f)( res.second, *res.first, val );
+                    f( res.second, *res.first, val );
                     return std::make_pair( true, res.second );
                 }
 
@@ -250,7 +250,7 @@ namespace cds { namespace intrusive {
                     if (it == m_Set.end())
                         return nullptr;
                     value_type& val = *it;
-                    cds::unref(f)( val );
+                    f( val );
                     m_Set.erase( it );
                     return &val;
                 }
@@ -262,7 +262,7 @@ namespace cds { namespace intrusive {
                     if (it == m_Set.end())
                         return nullptr;
                     value_type& val = *it;
-                    cds::unref(f)( val );
+                    f( val );
                     m_Set.erase( it );
                     return &val;
                 }
@@ -279,7 +279,7 @@ namespace cds { namespace intrusive {
                     iterator it = m_Set.find( key, cmp );
                     if ( it == m_Set.end() )
                         return false;
-                    cds::unref(f)( *it, key );
+                    f( *it, key );
                     return true;
                 }
 
index 1bda29ae1fc52c08d891e5ef62d3e2589856811d..c0b34001c33dffba35e91754350a12c64b0680a4 100644 (file)
@@ -76,7 +76,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 iterator it = find_key( val, find_predicate() );
                 if ( it == m_List.end() || key_comparator()( val, *it ) != 0 ) {
                     m_List.insert( it, val );
-                    cds::unref( f )( val );
+                    f( val );
 
                     return true;
                 }
@@ -92,12 +92,12 @@ namespace cds { namespace intrusive { namespace striped_set {
                 if ( it == m_List.end() || key_comparator()( val, *it ) != 0 ) {
                     // insert new
                     m_List.insert( it, val );
-                    cds::unref( f )( true, val, val );
+                    f( true, val, val );
                     return std::make_pair( true, true );
                 }
                 else {
                     // already exists
-                    cds::unref( f )( false, *it, val );
+                    f( false, *it, val );
                     return std::make_pair( true, false );
                 }
             }
@@ -121,7 +121,7 @@ namespace cds { namespace intrusive { namespace striped_set {
 
                 // key exists
                 value_type& val = *it;
-                cds::unref( f )( val );
+                f( val );
                 m_List.erase( it );
 
                 return &val;
@@ -136,7 +136,7 @@ namespace cds { namespace intrusive { namespace striped_set {
 
                 // key exists
                 value_type& val = *it;
-                cds::unref( f )( val );
+                f( val );
                 m_List.erase( it );
 
                 return &val;
@@ -156,7 +156,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *it, key );
+                f( *it, key );
                 return true;
             }
 
index 8edced6816e2b053ced981e67f8ccb44a1d6c9df..65680fea44cbf74915cf99b4751cb9ea717f1a99 100644 (file)
@@ -77,7 +77,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 // key exists
                 iterator it = pos.first;
                 value_type& val = *(++it);
-                cds::unref( f )( val );
+                f( val );
                 m_List.erase_after( pos.first );
 
                 return &val;
@@ -101,7 +101,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 std::pair< iterator, bool > pos = find_prev_item( val );
                 if ( !pos.second ) {
                     m_List.insert_after( pos.first, val );
-                    cds::unref( f )( val );
+                    f( val );
                     return true;
                 }
 
@@ -116,12 +116,12 @@ namespace cds { namespace intrusive { namespace striped_set {
                 if ( !pos.second ) {
                     // insert new
                     m_List.insert_after( pos.first, val );
-                    cds::unref( f )( true, val, val );
+                    f( true, val, val );
                     return std::make_pair( true, true );
                 }
                 else {
                     // already exists
-                    cds::unref( f )( false, *(++pos.first), val );
+                    f( false, *(++pos.first), val );
                     return std::make_pair( true, false );
                 }
             }
@@ -160,7 +160,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *(++pos.first), key );
+                f( *(++pos.first), key );
                 return true;
             }
 
@@ -172,7 +172,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                     return false;
 
                 // key exists
-                cds::unref( f )( *(++pos.first), key );
+                f( *(++pos.first), key );
                 return true;
             }
 
index f4a8fb3c1c2c0bde4542565c779e4b032e60997f..b2009b2fad36d197252a8a33f24ec9a0679efba9 100644 (file)
@@ -77,7 +77,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             {
                 std::pair<iterator, bool> res = m_Set.insert( val );
                 if ( res.second )
-                    cds::unref(f)( val );
+                    f( val );
                 return res.second;
             }
 
@@ -85,7 +85,7 @@ namespace cds { namespace intrusive { namespace striped_set {
             std::pair<bool, bool> ensure( value_type& val, Func f )
             {
                 std::pair<iterator, bool> res = m_Set.insert( val );
-                cds::unref(f)( res.second, *res.first, val );
+                f( res.second, *res.first, val );
                 return std::make_pair( true, res.second );
             }
 
@@ -105,7 +105,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 if ( it == m_Set.end() )
                     return nullptr;
                 value_type& val = *it;
-                cds::unref(f)( val );
+                f( val );
                 m_Set.erase( it );
                 return &val;
             }
@@ -117,7 +117,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 if ( it == m_Set.end() )
                     return nullptr;
                 value_type& val = *it;
-                cds::unref(f)( val );
+                f( val );
                 m_Set.erase( it );
                 return &val;
             }
@@ -128,7 +128,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 iterator it = m_Set.find( key, typename container_type::hasher(), typename container_type::key_equal() );
                 if ( it == m_Set.end() )
                     return false;
-                cds::unref(f)( *it, key );
+                f( *it, key );
                 return true;
             }
 
@@ -138,7 +138,7 @@ namespace cds { namespace intrusive { namespace striped_set {
                 iterator it = m_Set.find( key, typename container_type::hasher(), equal_from_compare<Less>(pred) );
                 if ( it == m_Set.end() )
                     return false;
-                cds::unref(f)( *it, key );
+                f( *it, key );
                 return true;
             }
 
index 48d179194d9c474643ae7b2128677092affb6909..09b03c3edb8f16864c9ad97ead7d87bf9e30c69f 100644 (file)
@@ -4,8 +4,8 @@
 #define __CDS_INTRUSIVE_TREIBER_STACK_H
 
 #include <type_traits>
+#include <functional>   // ref
 #include <cds/intrusive/details/single_link_struct.h>
-#include <cds/ref.h>
 #include <cds/algo/elimination.h>
 #include <cds/opt/buffer.h>
 #include <cds/lock/spinlock.h>
index 5d6108ca17b84de1ce5aab1d4e3c427c146a8d53..f9bbb360a74ee097be6f59b30ca2486168d49779 100644 (file)
@@ -3,11 +3,11 @@
 #ifndef __CDS_INTRUSIVE_TSIGAS_CYCLE_QUEUE_H
 #define __CDS_INTRUSIVE_TSIGAS_CYCLE_QUEUE_H
 
+#include <functional>   // ref
 #include <cds/intrusive/details/base.h>
 #include <cds/cxx11_atomic.h>
 #include <cds/details/bounded_container.h>
 #include <cds/opt/buffer.h>
-#include <cds/ref.h>
 
 namespace cds { namespace intrusive {
 
@@ -343,7 +343,7 @@ namespace cds { namespace intrusive {
                 void operator ()( T * val );
             };
             \endcode
-            You can pass \p disposer by reference using \p boost::ref.
+            You can pass \p disposer by reference using \p std::ref.
             The disposer will be called immediately for each item.
         */
         template <typename Disposer>
@@ -351,7 +351,7 @@ namespace cds { namespace intrusive {
         {
             value_type * pv;
             while ( (pv = pop()) != nullptr ) {
-                unref(f)( pv );
+                f( pv );
             }
         }
 
index 165cdb46509e9553938ba4a697c33dbcdc4d51b1..03382df37a2496ed9b8f784a459420c84acbb60e 100644 (file)
@@ -127,7 +127,7 @@ namespace cds { namespace intrusive {
                 void operator ()( T * val );
             };
             \endcode
-            You can pass \p disposer by reference using \p boost::ref.
+            You can pass \p disposer by reference using \p std::ref.
             The disposer will be called immediately for each item.
         */
         template <typename Disposer>
@@ -135,7 +135,7 @@ namespace cds { namespace intrusive {
         {
             value_type * pv;
             while ( (pv = pop()) != nullptr ) {
-                unref(f)( pv );
+                f( pv );
             }
         }
 
diff --git a/cds/ref.h b/cds/ref.h
deleted file mode 100644 (file)
index d03650e..0000000
--- a/cds/ref.h
+++ /dev/null
@@ -1,54 +0,0 @@
-//$$CDS-header$$
-
-#ifndef __CDS_REF_H
-#define __CDS_REF_H
-
-#include <cds/details/defs.h>
-#include <boost/ref.hpp>
-
-//@cond
-namespace cds {
-
-    using boost::ref;
-
-    namespace details {
-        template <typename T>
-        struct unwrap_reference
-        {
-            typedef T type;
-            static T apply(T f)
-            {
-                return f;
-            }
-        };
-
-        template <typename T>
-        struct unwrap_reference<T&>
-        {
-            typedef T& type;
-            static T& apply( T& f )
-            {
-                return f;
-            }
-        };
-
-        template <typename T>
-        struct unwrap_reference<boost::reference_wrapper<T> >
-        {
-            typedef T& type;
-            static T& apply( boost::reference_wrapper<T> f )
-            {
-                return f.get();
-            }
-        };
-    }
-
-    template <typename T>
-    static inline typename details::unwrap_reference<T>::type unref( T f )
-    {
-        return cds::details::unwrap_reference<T>::apply(f);
-    }
-}
-//@endcond
-
-#endif // #ifndef __CDS_REF_H
index ccc7cfa910d72d2570299818bd4f44ed65627cdf..40310cf752675120e9413a86ff41f361378c9a29 100644 (file)
@@ -7,7 +7,7 @@
 #include "cppunit/cppunit_proxy.h"
 #include <cds/os/timer.h>
 #include <cds/opt/hash.h>
-#include <cds/ref.h>
+#include <functional>   // ref
 #include <algorithm>    // random_shuffle
 
 namespace cds { namespace container {}}
@@ -259,19 +259,19 @@ namespace map {
 
             // find test
             check_value chk(10);
-            CPPUNIT_ASSERT( m.find( 10, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find_with( 25, predicate(), boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find_with( 25, predicate(), std::ref(chk) ));
             chk.m_nExpected = 90;
-            CPPUNIT_ASSERT( m.find( 30, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 30, std::ref(chk) ));
             chk.m_nExpected = 54;
-            CPPUNIT_ASSERT( m.find( 27, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 27, std::ref(chk) ));
 
             ensureResult = m.ensure( 10, insert_functor<Map>() ) ;   // value = 50
             CPPUNIT_ASSERT( ensureResult.first );
             CPPUNIT_ASSERT( !ensureResult.second );
             chk.m_nExpected = 50;
-            CPPUNIT_ASSERT( m.find( 10, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
 
             // erase test
             CPPUNIT_ASSERT( !m.find(100) );
@@ -301,20 +301,20 @@ namespace map {
 
             CPPUNIT_ASSERT( !m.find(29) );
             CPPUNIT_ASSERT( m.insert(29, 290))
-            CPPUNIT_ASSERT( m.erase_with( 29, predicate(), boost::ref(ext)));
+            CPPUNIT_ASSERT( m.erase_with( 29, predicate(), std::ref(ext)));
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
             CPPUNIT_ASSERT( nVal == 290 );
             nVal = -1;
-            CPPUNIT_ASSERT( !m.erase_with( 29, predicate(), boost::ref(ext)));
+            CPPUNIT_ASSERT( !m.erase_with( 29, predicate(), std::ref( ext ) ) );
             CPPUNIT_ASSERT( nVal == -1 );
 
-            CPPUNIT_ASSERT( m.erase( 30, boost::ref(ext)));
+            CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) );
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 2 ));
             CPPUNIT_ASSERT( nVal == 90 );
             nVal = -1;
-            CPPUNIT_ASSERT( !m.erase( 30, boost::ref(ext)));
+            CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) );
             CPPUNIT_ASSERT( nVal == -1 );
 
             m.clear();
@@ -330,15 +330,15 @@ namespace map {
             CPPUNIT_ASSERT( check_size( m, 3 ));
 
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find( 126, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
             chk.m_nExpected = 731;
-            CPPUNIT_ASSERT( m.find_with( 137, predicate(), cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find_with( 137, predicate(), std::ref(chk) ));
             chk.m_nExpected = 941;
-            CPPUNIT_ASSERT( m.find( 149, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 149, std::ref(chk) ));
 
             CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find( 126, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
 
index 08a3fa6c27269790393dde167897a040eabcb0d2..e54ac4ed31b2432af404fdfdb23713777b75b2e8 100644 (file)
@@ -7,7 +7,7 @@
 #include "cppunit/cppunit_proxy.h"
 #include <cds/os/timer.h>
 #include <cds/opt/hash.h>
-#include <cds/ref.h>
+#include <functional>   // ref
 #include <algorithm>    // random_shuffle
 
 namespace cds { namespace container {}}
@@ -379,19 +379,19 @@ namespace map {
 
             // find test
             check_value chk(10);
-            CPPUNIT_ASSERT( m.find( 10, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find_with( 25, less(), boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find_with( 25, less(), std::ref( chk ) ) );
             chk.m_nExpected = 90;
-            CPPUNIT_ASSERT( m.find( 30, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 30, std::ref( chk ) ) );
             chk.m_nExpected = 54;
-            CPPUNIT_ASSERT( m.find( 27, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 27, std::ref( chk ) ) );
 
             ensureResult = m.ensure( 10, insert_functor<Map>() ) ;   // value = 50
             CPPUNIT_ASSERT( ensureResult.first );
             CPPUNIT_ASSERT( !ensureResult.second );
             chk.m_nExpected = 50;
-            CPPUNIT_ASSERT( m.find( 10, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 10, std::ref( chk ) ) );
 
             // erase test
             CPPUNIT_ASSERT( !m.find(100) );
@@ -422,20 +422,20 @@ namespace map {
             CPPUNIT_ASSERT( !m.find(29) );
             CPPUNIT_ASSERT( m.insert(29, 290));
             CPPUNIT_ASSERT( check_size( m, 4 ));
-            CPPUNIT_ASSERT( m.erase_with( 29, less(), boost::ref(ext)));
+            CPPUNIT_ASSERT( m.erase_with( 29, less(), std::ref( ext ) ) );
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
             CPPUNIT_ASSERT( nVal == 290 );
             nVal = -1;
-            CPPUNIT_ASSERT( !m.erase_with( 29, less(), boost::ref(ext)));
+            CPPUNIT_ASSERT( !m.erase_with( 29, less(), std::ref( ext ) ) );
             CPPUNIT_ASSERT( nVal == -1 );
 
-            CPPUNIT_ASSERT( m.erase( 30, boost::ref(ext)));
+            CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) );
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 2 ));
             CPPUNIT_ASSERT( nVal == 90 );
             nVal = -1;
-            CPPUNIT_ASSERT( !m.erase( 30, boost::ref(ext)));
+            CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) );
             CPPUNIT_ASSERT( nVal == -1 );
 
             m.clear();
@@ -451,15 +451,15 @@ namespace map {
             CPPUNIT_ASSERT( check_size( m, 3 ));
 
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find( 126, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
             chk.m_nExpected = 731;
-            CPPUNIT_ASSERT( m.find_with( 137, less(), cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find_with( 137, less(), std::ref(chk) ));
             chk.m_nExpected = 941;
-            CPPUNIT_ASSERT( m.find( 149, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 149, std::ref(chk) ));
 
             CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find( 126, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
 
index 352c26ef204a9979bf3301132f241617f948189a..5474902760b57c6c9abc8fac391eb927f8ed7624 100644 (file)
@@ -7,7 +7,7 @@
 #include "cppunit/cppunit_proxy.h"
 #include <cds/os/timer.h>
 #include <cds/opt/hash.h>
-#include <cds/ref.h>
+#include <functional>   // ref
 #include <algorithm>    // random_shuffle
 
 namespace cds { namespace container {}}
@@ -208,19 +208,19 @@ namespace map {
 
             // find test
             check_value chk(10);
-            CPPUNIT_ASSERT( m.find( 10, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find( 25, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 25, std::ref( chk ) ) );
             chk.m_nExpected = 90;
-            CPPUNIT_ASSERT( m.find( 30, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 30, std::ref( chk ) ) );
             chk.m_nExpected = 54;
-            CPPUNIT_ASSERT( m.find( 27, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 27, std::ref( chk ) ) );
 
             ensureResult = m.ensure( 10, insert_functor<Map>() ) ;   // value = 50
             CPPUNIT_ASSERT( ensureResult.first );
             CPPUNIT_ASSERT( !ensureResult.second );
             chk.m_nExpected = 50;
-            CPPUNIT_ASSERT( m.find( 10, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 10, std::ref( chk ) ) );
 
             // erase test
             CPPUNIT_ASSERT( !m.find(100) );
@@ -251,20 +251,20 @@ namespace map {
             CPPUNIT_ASSERT( !m.find(29) );
             CPPUNIT_ASSERT( m.insert(29, 290));
             CPPUNIT_ASSERT( check_size( m, 4 ));
-            CPPUNIT_ASSERT( m.erase( 29, boost::ref(ext)));
+            CPPUNIT_ASSERT( m.erase( 29, std::ref( ext ) ) );
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
             CPPUNIT_ASSERT( nVal == 290 );
             nVal = -1;
-            CPPUNIT_ASSERT( !m.erase( 29, boost::ref(ext)));
+            CPPUNIT_ASSERT( !m.erase( 29, std::ref( ext ) ) );
             CPPUNIT_ASSERT( nVal == -1 );
 
-            CPPUNIT_ASSERT( m.erase( 30, boost::ref(ext)));
+            CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) );
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 2 ));
             CPPUNIT_ASSERT( nVal == 90 );
             nVal = -1;
-            CPPUNIT_ASSERT( !m.erase( 30, boost::ref(ext)));
+            CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) );
             CPPUNIT_ASSERT( nVal == -1 );
 
             m.clear();
@@ -280,15 +280,15 @@ namespace map {
             CPPUNIT_ASSERT( check_size( m, 3 ));
 
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find( 126, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
             chk.m_nExpected = 731;
-            CPPUNIT_ASSERT( m.find( 137, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 137, std::ref(chk) ));
             chk.m_nExpected = 941;
-            CPPUNIT_ASSERT( m.find( 149, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 149, std::ref(chk) ));
 
             CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find( 126, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
 
@@ -412,19 +412,19 @@ namespace map {
 
             // find test
             check_value chk(10);
-            CPPUNIT_ASSERT( m.find( 10, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find_with( 25, less(), boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find_with( 25, less(), std::ref( chk ) ) );
             chk.m_nExpected = 90;
-            CPPUNIT_ASSERT( m.find( 30, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 30, std::ref( chk ) ) );
             chk.m_nExpected = 54;
-            CPPUNIT_ASSERT( m.find( 27, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 27, std::ref( chk ) ) );
 
             ensureResult = m.ensure( 10, insert_functor<Map>() ) ;   // value = 50
             CPPUNIT_ASSERT( ensureResult.first );
             CPPUNIT_ASSERT( !ensureResult.second );
             chk.m_nExpected = 50;
-            CPPUNIT_ASSERT( m.find( 10, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 10, std::ref( chk ) ) );
 
             // erase test
             CPPUNIT_ASSERT( !m.find(100) );
@@ -454,20 +454,20 @@ namespace map {
 
             CPPUNIT_ASSERT( !m.find(29) );
             CPPUNIT_ASSERT( m.insert(29, 290))
-            CPPUNIT_ASSERT( m.erase_with( 29, less(), boost::ref(ext)));
+                CPPUNIT_ASSERT( m.erase_with( 29, less(), std::ref( ext ) ) );
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
             CPPUNIT_ASSERT( nVal == 290 );
             nVal = -1;
-            CPPUNIT_ASSERT( !m.erase_with( 29, less(), boost::ref(ext)));
+            CPPUNIT_ASSERT( !m.erase_with( 29, less(), std::ref( ext ) ) );
             CPPUNIT_ASSERT( nVal == -1 );
 
-            CPPUNIT_ASSERT( m.erase( 30, boost::ref(ext)));
+            CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) );
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 2 ));
             CPPUNIT_ASSERT( nVal == 90 );
             nVal = -1;
-            CPPUNIT_ASSERT( !m.erase( 30, boost::ref(ext)));
+            CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) );
             CPPUNIT_ASSERT( nVal == -1 );
 
             m.clear();
@@ -483,15 +483,15 @@ namespace map {
             CPPUNIT_ASSERT( check_size( m, 3 ));
 
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find( 126, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
             chk.m_nExpected = 731;
-            CPPUNIT_ASSERT( m.find_with( 137, less(), cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find_with( 137, less(), std::ref(chk) ));
             chk.m_nExpected = 941;
-            CPPUNIT_ASSERT( m.find( 149, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 149, std::ref(chk) ));
 
             CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find( 126, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
 
index f7b9eb5236952442b3b0ebffcc01f43c1bfd426d..177a2d1b81b080d510a632c26e01efc3b286d860 100644 (file)
@@ -243,8 +243,8 @@ namespace ordlist {
             // passed by ref
             {
                 insert_functor f;
-                CPPUNIT_ASSERT( l.insert( item(25), boost::ref(f)) );
-                CPPUNIT_ASSERT( !l.insert( item(100), boost::ref(f)) );
+                CPPUNIT_ASSERT( l.insert( item( 25 ), std::ref( f ) ) );
+                CPPUNIT_ASSERT( !l.insert( item( 100 ), std::ref( f ) ) );
             }
             // Test insert with function
             CPPUNIT_ASSERT( l.insert( 50, insert_function ));
@@ -265,7 +265,7 @@ namespace ordlist {
                     check_value f(1033);
                     i = 25;
                     CPPUNIT_ASSERT( l.find_with( 25, lt<value_type>() ));
-                    CPPUNIT_ASSERT( l.find_with( i, lt<value_type>(), boost::ref(f) ));
+                    CPPUNIT_ASSERT( l.find_with( i, lt<value_type>(), std::ref( f ) ) );
                 }
                 i = 50;
                 CPPUNIT_ASSERT( l.find( 50 ));
@@ -296,7 +296,7 @@ namespace ordlist {
                 CPPUNIT_ASSERT( ensureResult.first );
                 CPPUNIT_ASSERT( ensureResult.second );
 
-                ensureResult = l.ensure( 200, boost::ref(f) );
+                ensureResult = l.ensure( 200, std::ref( f ) );
                 CPPUNIT_ASSERT( ensureResult.first );
                 CPPUNIT_ASSERT( ensureResult.second );
 
@@ -343,14 +343,14 @@ namespace ordlist {
             {
                 erase_functor ef;
                 CPPUNIT_ASSERT( ef.nEraseCall == 0 );
-                CPPUNIT_ASSERT( l.erase_with( 160, lt<value_type>(), cds::ref(ef) ));
+                CPPUNIT_ASSERT( l.erase_with( 160, lt<value_type>(), std::ref(ef) ));
                 CPPUNIT_ASSERT( ef.nEraseCall == 1 );
-                CPPUNIT_ASSERT( !l.erase_with( 160, lt<value_type>(), cds::ref(ef) ));
+                CPPUNIT_ASSERT( !l.erase_with( 160, lt<value_type>(), std::ref(ef) ));
                 CPPUNIT_ASSERT( ef.nEraseCall == 1 );
 
-                CPPUNIT_ASSERT( l.erase( 250, cds::ref(ef) ));
+                CPPUNIT_ASSERT( l.erase( 250, std::ref(ef) ));
                 CPPUNIT_ASSERT( ef.nEraseCall == 2 );
-                CPPUNIT_ASSERT( !l.erase( 250, cds::ref(ef) ));
+                CPPUNIT_ASSERT( !l.erase( 250, std::ref(ef) ));
                 CPPUNIT_ASSERT( ef.nEraseCall == 2 );
             }
 
index e800f497dcf72e5589bad9e2a2278264530a912c..f24384bb1a467338e0a1b5597c3d2886dd2795fb 100644 (file)
@@ -119,27 +119,27 @@ namespace ordlist {
             CPPUNIT_ASSERT( l.find( 100 ));
 
             check_value chk(0);
-            CPPUNIT_ASSERT( l.find( 100, boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
 
             CPPUNIT_ASSERT( !l.find_with( 50, lt<key_type>() ));
             CPPUNIT_ASSERT( l.insert( 50, 500 ));
             CPPUNIT_ASSERT( l.find_with( 50, lt<key_type>() ));
             CPPUNIT_ASSERT( !l.insert( 50, 5 ));
             chk.m_nExpected = 500;
-            CPPUNIT_ASSERT( l.find( 50, boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find( 50, std::ref( chk ) ) );
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( l.find( 100, boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
             CPPUNIT_ASSERT( !l.empty() );
 
             CPPUNIT_ASSERT( !l.find( 150 ));
             CPPUNIT_ASSERT( l.insert_key( 150, insert_functor() ));
             CPPUNIT_ASSERT( l.find( 150 ));
             chk.m_nExpected = 1500;
-            CPPUNIT_ASSERT( l.find_with( 150, lt<key_type>(), boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find_with( 150, lt<key_type>(), std::ref( chk ) ) );
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( l.find( 100, boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
             chk.m_nExpected = 500;
-            CPPUNIT_ASSERT( l.find( 50, boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find( 50, std::ref( chk ) ) );
             CPPUNIT_ASSERT( !l.empty() );
 
             // erase test
@@ -150,7 +150,7 @@ namespace ordlist {
             CPPUNIT_ASSERT( l.find( 50 ));
             {
                 erase_functor ef;
-                l.erase( 50, boost::ref(ef));
+                l.erase( 50, std::ref( ef ) );
                 CPPUNIT_ASSERT( ef.nKey == 50 );
                 CPPUNIT_ASSERT( ef.nVal == 500 );
             }
@@ -162,16 +162,16 @@ namespace ordlist {
             CPPUNIT_ASSERT( bEnsureResult.first );
             CPPUNIT_ASSERT( !bEnsureResult.second );
             chk.m_nExpected = 5000;
-            CPPUNIT_ASSERT( l.find( 100, boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
 
             {
                 ensure_functor ef;
-                bEnsureResult = l.ensure( 50, boost::ref( ef ));
+                bEnsureResult = l.ensure( 50, std::ref( ef ) );
             }
             CPPUNIT_ASSERT( bEnsureResult.first );
             CPPUNIT_ASSERT( bEnsureResult.second );
             chk.m_nExpected = 2500;
-            CPPUNIT_ASSERT( l.find( 50, boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find( 50, std::ref( chk ) ) );
 
             // erase test
             CPPUNIT_ASSERT( !l.empty() );
@@ -181,7 +181,7 @@ namespace ordlist {
             CPPUNIT_ASSERT( l.erase( 150 ));
             {
                 erase_functor ef;
-                CPPUNIT_ASSERT( l.erase_with( 200, lt<key_type>(), cds::ref(ef)) );
+                CPPUNIT_ASSERT( l.erase_with( 200, lt<key_type>(), std::ref(ef)) );
                 CPPUNIT_ASSERT( ef.nKey == 200 );
                 CPPUNIT_ASSERT( ef.nVal == 2000 );
             }
@@ -202,9 +202,9 @@ namespace ordlist {
             CPPUNIT_ASSERT( !l.emplace( 251, 10) );
 
             check_value cv(0);
-            CPPUNIT_ASSERT( l.find( 501, cds::ref(cv) ));
+            CPPUNIT_ASSERT( l.find( 501, std::ref(cv) ));
             cv.m_nExpected = 152;
-            CPPUNIT_ASSERT( l.find( 251, cds::ref(cv) ));
+            CPPUNIT_ASSERT( l.find( 251, std::ref(cv) ));
 
             l.clear();
             CPPUNIT_ASSERT( l.empty() );
@@ -225,7 +225,7 @@ namespace ordlist {
                 // Check that we have visited all items
                 for ( int i = 0; i < nCount; ++i ) {
                     chk.m_nExpected = i * 3;
-                    CPPUNIT_ASSERT( l.find( i, boost::ref(chk) ));
+                    CPPUNIT_ASSERT( l.find( i, std::ref( chk ) ) );
                 }
 
                 l.clear();
@@ -245,7 +245,7 @@ namespace ordlist {
                 // Check that we have visited all items
                 for ( int i = nCount; i > 0; --i ) {
                     chk.m_nExpected = (i - 1) * 7;
-                    CPPUNIT_ASSERT( l.find_with( i - 1, lt<key_type>(), boost::ref(chk) ));
+                    CPPUNIT_ASSERT( l.find_with( i - 1, lt<key_type>(), std::ref( chk ) ) );
                 }
 
                 l.clear();
index 02465fc08878551ad96a83d6d613758ba8bdde4a..380ae236f624b2a1db006fb28bec845e85d0a01b 100644 (file)
@@ -244,8 +244,8 @@ namespace ordlist {
             // passed by ref
             {
                 insert_functor f;
-                CPPUNIT_ASSERT( l.insert( item(25), boost::ref(f)) );
-                CPPUNIT_ASSERT( !l.insert( item(100), boost::ref(f)) );
+                CPPUNIT_ASSERT( l.insert( item( 25 ), std::ref( f ) ) );
+                CPPUNIT_ASSERT( !l.insert( item( 100 ), std::ref( f ) ) );
             }
             // Test insert with function
             CPPUNIT_ASSERT( l.insert( 50, insert_function ));
@@ -265,7 +265,7 @@ namespace ordlist {
                     check_value f(1033);
                     i = 25;
                     CPPUNIT_ASSERT( l.find_with( 25, lt<value_type>() ));
-                    CPPUNIT_ASSERT( l.find_with( i, lt<value_type>(), boost::ref(f) ));
+                    CPPUNIT_ASSERT( l.find_with( i, lt<value_type>(), std::ref( f ) ) );
                 }
                 i = 50;
                 CPPUNIT_ASSERT( l.find( 50 ));
@@ -296,7 +296,7 @@ namespace ordlist {
                 CPPUNIT_ASSERT( ensureResult.first );
                 CPPUNIT_ASSERT( ensureResult.second );
 
-                ensureResult = l.ensure( 200, boost::ref(f) );
+                ensureResult = l.ensure( 200, std::ref( f ) );
                 CPPUNIT_ASSERT( ensureResult.first );
                 CPPUNIT_ASSERT( ensureResult.second );
 
@@ -343,14 +343,14 @@ namespace ordlist {
             {
                 erase_functor ef;
                 CPPUNIT_ASSERT( ef.nEraseCall == 0 );
-                CPPUNIT_ASSERT( l.erase_with( 160, lt<value_type>(), cds::ref(ef) ));
+                CPPUNIT_ASSERT( l.erase_with( 160, lt<value_type>(), std::ref(ef) ));
                 CPPUNIT_ASSERT( ef.nEraseCall == 1 );
-                CPPUNIT_ASSERT( !l.erase_with( 160, lt<value_type>(), cds::ref(ef) ));
+                CPPUNIT_ASSERT( !l.erase_with( 160, lt<value_type>(), std::ref(ef) ));
                 CPPUNIT_ASSERT( ef.nEraseCall == 1 );
 
-                CPPUNIT_ASSERT( l.erase( 250, cds::ref(ef) ));
+                CPPUNIT_ASSERT( l.erase( 250, std::ref(ef) ));
                 CPPUNIT_ASSERT( ef.nEraseCall == 2 );
-                CPPUNIT_ASSERT( !l.erase( 250, cds::ref(ef) ));
+                CPPUNIT_ASSERT( !l.erase( 250, std::ref(ef) ));
                 CPPUNIT_ASSERT( ef.nEraseCall == 2 );
             }
 
index 263ee1ab00da4f992fdfff84f6f7cc0ac4ae3e1e..7aaa8c619cb5f7616c7b541e35fee6c586b13aab 100644 (file)
@@ -119,27 +119,27 @@ namespace ordlist {
             CPPUNIT_ASSERT( l.find( 100 ));
 
             check_value chk(0);
-            CPPUNIT_ASSERT( l.find( 100, boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
 
             CPPUNIT_ASSERT( !l.find_with( 50, lt<key_type>() ));
             CPPUNIT_ASSERT( l.insert( 50, 500 ));
             CPPUNIT_ASSERT( l.find_with( 50, lt<key_type>() ));
             CPPUNIT_ASSERT( !l.insert( 50, 5 ));
             chk.m_nExpected = 500;
-            CPPUNIT_ASSERT( l.find_with( 50, lt<key_type>(), boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find_with( 50, lt<key_type>(), std::ref( chk ) ) );
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( l.find_with( 100, lt<key_type>(), boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find_with( 100, lt<key_type>(), std::ref( chk ) ) );
             CPPUNIT_ASSERT( !l.empty() );
 
             CPPUNIT_ASSERT( !l.find( 150 ));
             CPPUNIT_ASSERT( l.insert_key( 150, insert_functor() ));
             CPPUNIT_ASSERT( l.find( 150 ));
             chk.m_nExpected = 1500;
-            CPPUNIT_ASSERT( l.find( 150, boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find( 150, std::ref( chk ) ) );
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( l.find( 100, boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
             chk.m_nExpected = 500;
-            CPPUNIT_ASSERT( l.find( 50, boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find( 50, std::ref( chk ) ) );
             CPPUNIT_ASSERT( !l.empty() );
 
             // erase test
@@ -150,7 +150,7 @@ namespace ordlist {
             CPPUNIT_ASSERT( l.find( 50 ));
             {
                 erase_functor ef;
-                l.erase( 50, boost::ref(ef));
+                l.erase( 50, std::ref( ef ) );
                 CPPUNIT_ASSERT( ef.nKey == 50 );
                 CPPUNIT_ASSERT( ef.nVal == 500 );
             }
@@ -162,16 +162,16 @@ namespace ordlist {
             CPPUNIT_ASSERT( bEnsureResult.first );
             CPPUNIT_ASSERT( !bEnsureResult.second );
             chk.m_nExpected = 5000;
-            CPPUNIT_ASSERT( l.find( 100, boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find( 100, std::ref( chk ) ) );
 
             {
                 ensure_functor ef;
-                bEnsureResult = l.ensure( 50, boost::ref( ef ));
+                bEnsureResult = l.ensure( 50, std::ref( ef ) );
             }
             CPPUNIT_ASSERT( bEnsureResult.first );
             CPPUNIT_ASSERT( bEnsureResult.second );
             chk.m_nExpected = 2500;
-            CPPUNIT_ASSERT( l.find( 50, boost::ref( chk ) ));
+            CPPUNIT_ASSERT( l.find( 50, std::ref( chk ) ) );
 
             // erase test
             CPPUNIT_ASSERT( !l.empty() );
@@ -181,7 +181,7 @@ namespace ordlist {
             CPPUNIT_ASSERT( l.erase( 150 ));
             {
                 erase_functor ef;
-                CPPUNIT_ASSERT( l.erase_with( 200, lt<key_type>(), cds::ref(ef)) );
+                CPPUNIT_ASSERT( l.erase_with( 200, lt<key_type>(), std::ref(ef)) );
                 CPPUNIT_ASSERT( ef.nKey == 200 );
                 CPPUNIT_ASSERT( ef.nVal == 2000 );
             }
@@ -202,9 +202,9 @@ namespace ordlist {
             CPPUNIT_ASSERT( !l.emplace( 251, 10) );
 
             check_value cv(0);
-            CPPUNIT_ASSERT( l.find( 501, cds::ref(cv) ));
+            CPPUNIT_ASSERT( l.find( 501, std::ref(cv) ));
             cv.m_nExpected = 152;
-            CPPUNIT_ASSERT( l.find( 251, cds::ref(cv) ));
+            CPPUNIT_ASSERT( l.find( 251, std::ref(cv) ));
 
             l.clear();
             CPPUNIT_ASSERT( l.empty() );
@@ -230,7 +230,7 @@ namespace ordlist {
                 // Check that we have visited all items
                 for ( int i = 0; i < nCount; ++i ) {
                     chk.m_nExpected = i * 3;
-                    CPPUNIT_ASSERT( l.find( i, boost::ref(chk) ));
+                    CPPUNIT_ASSERT( l.find( i, std::ref( chk ) ) );
                 }
 
                 l.clear();
@@ -255,7 +255,7 @@ namespace ordlist {
                 // Check that we have visited all items
                 for ( int i = 0; i < nCount; ++i ) {
                     chk.m_nExpected = i * 7;
-                    CPPUNIT_ASSERT( l.find_with( i, lt<key_type>(),  boost::ref(chk) ));
+                    CPPUNIT_ASSERT( l.find_with( i, lt<key_type>(), std::ref( chk ) ) );
                 }
 
                 l.clear();
index 70b86eb2bef33f6a80759830aa853315222967e0..2e7f8671ea07daff14a300ae41a445325f27fd1c 100644 (file)
@@ -6,7 +6,7 @@
 #include "cppunit/cppunit_proxy.h"
 #include "size_check.h"
 #include <algorithm>
-#include <cds/ref.h>
+#include <functional>   // ref
 
 namespace priority_queue {
 
@@ -162,7 +162,7 @@ namespace priority_queue {
 
             {
                 intrusive_pqueue::another_disposer disp;
-                pq.clear_with( cds::ref(disp) );
+                pq.clear_with( std::ref(disp) );
                 CPPUNIT_ASSERT( pq.empty() );
                 CPPUNIT_ASSERT( !pq.full() );
                 CPPUNIT_ASSERT( pq.size() == 0 );
index cb8025b45585b3ff2440c767b361508d28c2b4e8..70366fa42e231c5b9201af6fbdff1e83585266be 100644 (file)
@@ -6,7 +6,7 @@
 #include "cppunit/cppunit_proxy.h"
 #include "size_check.h"
 #include <algorithm>
-#include <cds/ref.h>
+#include <functional>   // ref
 
 namespace priority_queue {
 
@@ -224,7 +224,7 @@ namespace priority_queue {
 
             {
                 pqueue::disposer disp;
-                pq.clear_with( cds::ref(disp) );
+                pq.clear_with( std::ref(disp) );
                 CPPUNIT_ASSERT( pq.empty() );
                 CPPUNIT_ASSERT( !pq.full() );
                 CPPUNIT_ASSERT( pq.size() == 0 );
index 633358b9042dce48bae56b8dc046b0fecb9170c2..f7621ad7eb2494f586bd0b713e460e4463969bc1 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "cppunit/cppunit_proxy.h"
 #include <cds/intrusive/details/base.h>
-#include <cds/ref.h>
+#include <functional>   // ref
 #include "size_check.h"
 
 namespace queue {
@@ -124,10 +124,10 @@ namespace queue {
                     nCount = 0;
                     while ( !q.empty() ) {
                         if ( nCount & 1 ) {
-                            CPPUNIT_ASSERT( q.pop( v, cds::ref(pf) ));
+                            CPPUNIT_ASSERT( q.pop( v, std::ref(pf) ));
                         }
                         else {
-                            CPPUNIT_ASSERT( q.dequeue( v, cds::ref(pf) ));
+                            CPPUNIT_ASSERT( q.dequeue( v, std::ref(pf) ));
                         }
 
                         // It is possible c_nItemCount % quasi_factor() != 0
index 442dd7dec3298126d54a091446cc524d21792479..c3f269a0df2766bc0b1006d1257db5cbf60e57ad 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <cds/opt/hash.h>
 #include <cds/os/timer.h>
-#include <cds/ref.h>
+#include <functional>   // ref
 #include <algorithm>    // random_shuffle
 
 // forward namespace declaration
@@ -353,7 +353,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 20;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
                 CPPUNIT_ASSERT( f.m_found.nFindCount == 1 );
@@ -361,7 +361,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 20;
-                CPPUNIT_ASSERT( s.find_with( key, pred, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find_with( key, pred, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
                 CPPUNIT_ASSERT( f.m_found.nFindCount == 1 );
@@ -376,7 +376,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 25;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 25 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 2500 );
             }
@@ -385,7 +385,7 @@ namespace set {
             key = 10;
             {
                 copy_found<item> f;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 10 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 10 );
                 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 0 );
@@ -397,7 +397,7 @@ namespace set {
             CPPUNIT_ASSERT( check_size( s, 3 ));
             {
                 copy_found<item> f;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 10 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 10 );
                 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 1 );
@@ -411,7 +411,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 13;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 13 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 1300 );
                 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 0 );
@@ -439,12 +439,12 @@ namespace set {
             CPPUNIT_ASSERT( s.find(20) );
             {
                 copy_found<item> f;
-                CPPUNIT_ASSERT( s.erase( 20, boost::ref(f) ));
+                CPPUNIT_ASSERT( s.erase( 20, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
 
                 CPPUNIT_ASSERT( s.insert(235))
-                    CPPUNIT_ASSERT( s.erase_with( 235, pred, boost::ref(f) ));
+                    CPPUNIT_ASSERT( s.erase_with( 235, pred, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 235 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 235 );
             }
@@ -470,17 +470,17 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 151;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 151 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 151 );
 
                 key = 174;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 174 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 471 );
 
                 key = 190;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 190 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 91 );
             }
index 33f36a224b94608e99145afe5f315c3f88f94a07..d383d861df9a3b8eee98deabca2060a8d8619412 100644 (file)
@@ -4,7 +4,7 @@
 #include "size_check.h"
 
 #include <cds/opt/hash.h>
-#include <cds/ref.h>
+#include <functional>   // ref
 #include <algorithm>    // random_shuffle
 
 // forward declaration
@@ -263,10 +263,10 @@ namespace set {
                 find_functor    ff;
                 CPPUNIT_ASSERT( !s.find( v3 ));
                 CPPUNIT_ASSERT( v3.nVal != v3.nKey * 100 );
-                CPPUNIT_ASSERT( s.insert( v3, cds::ref(fi) ));
+                CPPUNIT_ASSERT( s.insert( v3, std::ref(fi) ));
                 CPPUNIT_ASSERT( v3.nVal == v3.nKey * 100 );
                 CPPUNIT_ASSERT( v3.nFindCount == 0 );
-                CPPUNIT_ASSERT( s.find( v3, cds::ref(ff) ));
+                CPPUNIT_ASSERT( s.find( v3, std::ref(ff) ));
                 CPPUNIT_ASSERT( v3.nFindCount == 1 );
                 v3.nFindCount = 0;
                 CPPUNIT_ASSERT( check_size( s, 3 ));
@@ -630,7 +630,7 @@ namespace set {
                         CPPUNIT_ASSERT( s.find( v3 ) == nullptr );
                         CPPUNIT_ASSERT( s.insert( v3 ));
                         CPPUNIT_ASSERT( v3.nFindCount == 0 );
-                        CPPUNIT_ASSERT( s.find_with( v3, less<value_type>(), cds::ref(ff) ));
+                        CPPUNIT_ASSERT( s.find_with( v3, less<value_type>(), std::ref(ff) ));
                         CPPUNIT_ASSERT( v3.nFindCount == 1 );
                         v3.nFindCount = 0;
                         CPPUNIT_ASSERT( check_size( s, 3 ));
@@ -749,10 +749,10 @@ namespace set {
                 find_functor    ff;
                 ASSERT_RCU_FIND( !s.find( v3 ));
                 CPPUNIT_ASSERT( v3.nVal != v3.nKey * 100 );
-                CPPUNIT_ASSERT( s.insert( v3, cds::ref(fi) ));
+                CPPUNIT_ASSERT( s.insert( v3, std::ref(fi) ));
                 CPPUNIT_ASSERT( v3.nVal == v3.nKey * 100 );
                 CPPUNIT_ASSERT( v3.nFindCount == 0 );
-                CPPUNIT_ASSERT( s.find_with( v3, less<value_type>(), cds::ref(ff) ));
+                CPPUNIT_ASSERT( s.find_with( v3, less<value_type>(), std::ref(ff) ));
                 CPPUNIT_ASSERT( v3.nFindCount == 1 );
                 v3.nFindCount = 0;
                 CPPUNIT_ASSERT( check_size( s, 3 ));
index b7be051008b405c48de2f8b03fe24d0d33dd581f..f07be30d2f203081d6e58fa756d52a724a76a555 100644 (file)
@@ -370,7 +370,7 @@ namespace set {
                 CPPUNIT_ASSERT( s.find( v3 ) == nullptr );
                 CPPUNIT_ASSERT( s.insert( v3 ));
                 CPPUNIT_ASSERT( v3.nFindCount == 0 );
-                CPPUNIT_ASSERT( s.find( v3, cds::ref(ff) ));
+                CPPUNIT_ASSERT( s.find( v3, std::ref(ff) ));
                 CPPUNIT_ASSERT( v3.nFindCount == 1 );
                 v3.nFindCount = 0;
                 CPPUNIT_ASSERT( check_size( s, 3 ));
index c8e1e06f158cd39b923904300c670132abd33ae4..0146bd13839ba1d4aa8076c44450be4489bc780d 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <cds/opt/hash.h>
 #include <cds/os/timer.h>
-#include <cds/ref.h>
+#include <functional>   // ref
 #include <algorithm>    // random_shuffle
 
 // forward namespace declaration
@@ -511,7 +511,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 20;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
                 CPPUNIT_ASSERT( f.m_found.nFindCount == 1 );
@@ -520,7 +520,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 20;
-                CPPUNIT_ASSERT( s.find_with( key, less<value_type>(), boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find_with( key, less<value_type>(), std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
                 CPPUNIT_ASSERT( f.m_found.nFindCount == 2 );
@@ -535,7 +535,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 25;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 25 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 2500 );
             }
@@ -544,7 +544,7 @@ namespace set {
             key = 10;
             {
                 copy_found<item> f;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 10 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 10 );
                 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 0 );
@@ -556,7 +556,7 @@ namespace set {
             CPPUNIT_ASSERT( check_size( s, 3 ));
             {
                 copy_found<item> f;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 10 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 10 );
                 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 1 );
@@ -570,7 +570,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 13;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 13 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 1300 );
                 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 0 );
@@ -598,12 +598,12 @@ namespace set {
             CPPUNIT_ASSERT( s.find(20) );
             {
                 copy_found<item> f;
-                CPPUNIT_ASSERT( s.erase( 20, boost::ref(f) ));
+                CPPUNIT_ASSERT( s.erase( 20, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
 
                 CPPUNIT_ASSERT( s.insert(235))
-                CPPUNIT_ASSERT( s.erase_with( 235, less<value_type>(), boost::ref(f) ));
+                    CPPUNIT_ASSERT( s.erase_with( 235, less<value_type>(), std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 235 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 235 );
             }
@@ -629,17 +629,17 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 151;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 151 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 151 );
 
                 key = 174;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 174 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 471 );
 
                 key = 190;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 190 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 91 );
             }
index 1535615a76df6fc3c711b33d84f472cf9c448cfa..36d22b70ad64889d2fbd3a766477a9894af78e0e 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <cds/opt/hash.h>
 #include <cds/os/timer.h>
-#include <cds/ref.h>
+#include <functional>   // ref
 #include <algorithm>    // random_shuffle
 
 // forward namespace declaration
@@ -367,7 +367,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 20;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
                 CPPUNIT_ASSERT( f.m_found.nFindCount == 1 );
@@ -376,7 +376,7 @@ namespace set {
                 copy_found<item> f;
                 key = 20;
                 CPPUNIT_ASSERT( s.find( key, find_functor() ) );
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
                 CPPUNIT_ASSERT( f.m_found.nFindCount == 2 );
@@ -391,7 +391,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 25;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 25 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 2500 );
             }
@@ -400,7 +400,7 @@ namespace set {
             key = 10;
             {
                 copy_found<item> f;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 10 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 10 );
                 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 0 );
@@ -412,7 +412,7 @@ namespace set {
             CPPUNIT_ASSERT( check_size( s, 3 ));
             {
                 copy_found<item> f;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 10 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 10 );
                 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 1 );
@@ -426,7 +426,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 13;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 13 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 1300 );
                 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 0 );
@@ -454,12 +454,12 @@ namespace set {
             CPPUNIT_ASSERT( s.find(20) );
             {
                 copy_found<item> f;
-                CPPUNIT_ASSERT( s.erase( 20, boost::ref(f) ));
+                CPPUNIT_ASSERT( s.erase( 20, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
 
                 CPPUNIT_ASSERT( s.insert(235))
-                    CPPUNIT_ASSERT( s.erase( 235, boost::ref(f) ));
+                    CPPUNIT_ASSERT( s.erase( 235, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 235 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 235 );
             }
@@ -485,17 +485,17 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 151;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 151 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 151 );
 
                 key = 174;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 174 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 471 );
 
                 key = 190;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 190 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 91 );
             }
@@ -559,7 +559,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 20;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
                 CPPUNIT_ASSERT( f.m_found.nFindCount == 1 );
@@ -568,7 +568,7 @@ namespace set {
                 copy_found<item> f;
                 key = 20;
                 CPPUNIT_ASSERT( s.find_with( 20, less<value_type>(), find_functor() ) );
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
                 CPPUNIT_ASSERT( f.m_found.nFindCount == 2 );
@@ -583,7 +583,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 25;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 25 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 2500 );
             }
@@ -592,7 +592,7 @@ namespace set {
             key = 10;
             {
                 copy_found<item> f;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 10 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 10 );
                 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 0 );
@@ -604,7 +604,7 @@ namespace set {
             CPPUNIT_ASSERT( check_size( s, 3 ));
             {
                 copy_found<item> f;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 10 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 10 );
                 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 1 );
@@ -618,7 +618,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 13;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 13 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 1300 );
                 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 0 );
@@ -646,12 +646,12 @@ namespace set {
             CPPUNIT_ASSERT( s.find(20) );
             {
                 copy_found<item> f;
-                CPPUNIT_ASSERT( s.erase( 20, boost::ref(f) ));
+                CPPUNIT_ASSERT( s.erase( 20, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
 
                 CPPUNIT_ASSERT( s.insert(235))
-                CPPUNIT_ASSERT( s.erase_with( 235, less<value_type>(), boost::ref(f) ));
+                    CPPUNIT_ASSERT( s.erase_with( 235, less<value_type>(), std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 235 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 235 );
             }
@@ -677,17 +677,17 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 151;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 151 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 151 );
 
                 key = 174;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 174 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 471 );
 
                 key = 190;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 190 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 91 );
             }
index 0a20d07b2c6c8bd074c26d45368466dd43cdabad..c087779c616cbb59947ec487e13394fead8025dd 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "cppunit/cppunit_proxy.h"
 #include "size_check.h"
-#include <cds/ref.h>
+#include <functional>   // ref
 #include <algorithm>
 
 namespace tree {
@@ -263,19 +263,19 @@ namespace tree {
 
             // find test
             check_value chk(10);
-            CPPUNIT_ASSERT( m.find( 10, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find_with( 25, less(), boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find_with( 25, less(), std::ref( chk ) ) );
             chk.m_nExpected = 90;
-            CPPUNIT_ASSERT( m.find( 30, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 30, std::ref( chk ) ) );
             chk.m_nExpected = 54;
-            CPPUNIT_ASSERT( m.find( 27, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 27, std::ref( chk ) ) );
 
             ensureResult = m.ensure( 10, insert_functor<Map>() ) ;   // value = 50
             CPPUNIT_ASSERT( ensureResult.first );
             CPPUNIT_ASSERT( !ensureResult.second );
             chk.m_nExpected = 50;
-            CPPUNIT_ASSERT( m.find( 10, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 10, std::ref( chk ) ) );
 
             // erase test
             CPPUNIT_ASSERT( !m.find(100) );
@@ -306,20 +306,20 @@ namespace tree {
             CPPUNIT_ASSERT( !m.find(29) );
             CPPUNIT_ASSERT( m.insert(29, 290));
             CPPUNIT_ASSERT( check_size( m, 4 ));
-            CPPUNIT_ASSERT( m.erase_with( 29, less(), boost::ref(ext)));
+            CPPUNIT_ASSERT( m.erase_with( 29, less(), std::ref( ext ) ) );
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
             CPPUNIT_ASSERT( nVal == 290 );
             nVal = -1;
-            CPPUNIT_ASSERT( !m.erase_with( 29, less(), boost::ref(ext)));
+            CPPUNIT_ASSERT( !m.erase_with( 29, less(), std::ref( ext ) ) );
             CPPUNIT_ASSERT( nVal == -1 );
 
-            CPPUNIT_ASSERT( m.erase( 30, boost::ref(ext)));
+            CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) );
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 2 ));
             CPPUNIT_ASSERT( nVal == 90 );
             nVal = -1;
-            CPPUNIT_ASSERT( !m.erase( 30, boost::ref(ext)));
+            CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) );
             CPPUNIT_ASSERT( nVal == -1 );
 
             m.clear();
@@ -335,15 +335,15 @@ namespace tree {
             CPPUNIT_ASSERT( check_size( m, 3 ));
 
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find( 126, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
             chk.m_nExpected = 731;
-            CPPUNIT_ASSERT( m.find_with( 137, less(), cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find_with( 137, less(), std::ref(chk) ));
             chk.m_nExpected = 941;
-            CPPUNIT_ASSERT( m.find( 149, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 149, std::ref(chk) ));
 
             CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find( 126, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
 
index 06e916d48ccfd508070424ea585a574a25ec3cf6..24c11647dbeb1d0d65f926f55f116d7ce011a902 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "cppunit/cppunit_proxy.h"
 #include "size_check.h"
-#include <cds/ref.h>
+#include <functional>   // ref
 #include <algorithm>
 
 namespace tree {
@@ -302,7 +302,7 @@ namespace tree {
                 copy_found<value_type> f;
                 f.m_found.nKey = 0;
                 key = 20;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
                 CPPUNIT_ASSERT( f.m_found.stat.nFindFuncCall == 1 );
@@ -313,7 +313,7 @@ namespace tree {
                 copy_found<value_type> f;
                 f.m_found.nKey = 0;
                 key = 20;
-                CPPUNIT_ASSERT( s.find_with( key, less(), boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find_with( key, less(), std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
                 CPPUNIT_ASSERT( f.m_found.stat.nFindFuncCall == 2 );
@@ -323,7 +323,7 @@ namespace tree {
             {
                 copy_found<value_type> f;
                 f.m_found.nKey = 0;
-                CPPUNIT_ASSERT( s.find_with( 20, less(), boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find_with( 20, less(), std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
                 CPPUNIT_ASSERT( f.m_found.stat.nFindFuncCall == 2 );
@@ -341,7 +341,7 @@ namespace tree {
                 copy_found<value_type> f;
                 f.m_found.nKey = 0;
                 key = 25;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 25 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 2500 );
                 CPPUNIT_ASSERT( f.m_found.stat.nInsertFuncCall == 1 );
@@ -352,7 +352,7 @@ namespace tree {
             {
                 copy_found<value_type> f;
                 f.m_found.nKey = 0;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 10 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 100 );
                 CPPUNIT_ASSERT( f.m_found.stat.nEnsureExistFuncCall == 0 );
@@ -365,7 +365,7 @@ namespace tree {
             {
                 copy_found<value_type> f;
                 f.m_found.nKey = 0;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 10 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 100 );
                 CPPUNIT_ASSERT( f.m_found.stat.nEnsureExistFuncCall == 1 );
@@ -380,7 +380,7 @@ namespace tree {
                 copy_found<value_type> f;
                 f.m_found.nKey = 0;
                 key = 13;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 13 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 1300 );
                 CPPUNIT_ASSERT( f.m_found.stat.nEnsureExistFuncCall == 0 );
@@ -409,12 +409,12 @@ namespace tree {
             {
                 copy_found<value_type> f;
                 f.m_found.nKey = 0;
-                CPPUNIT_ASSERT( s.erase( 20, boost::ref(f) ));
+                CPPUNIT_ASSERT( s.erase( 20, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
 
                 CPPUNIT_ASSERT( s.insert(235))
-                CPPUNIT_ASSERT( s.erase_with( 235, less(), boost::ref(f) ));
+                CPPUNIT_ASSERT( s.erase_with( 235, less(), std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 235 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 2350 );
             }
@@ -441,17 +441,17 @@ namespace tree {
                 copy_found<value_type> f;
                 f.m_found.nKey = 0;
                 key = 151;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 151 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 1510 );
 
                 key = 174;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 174 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 471 );
 
                 key = 190;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 190 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 91 );
             }
index 765db471a25586eb01f6ff8ad4b7aedff5c86eda..d8a6e00cb292bf09802ea7efe72f8f0b7ac2ab08 100644 (file)
@@ -1,12 +1,12 @@
 //$$CDS-header$$
 
+#include <functional>
 #include "map2/map_types.h"
 #include "cppunit/thread.h"
 
 #include <cds/lock/spinlock.h>
 #include <vector>
 #include <algorithm>    // random_shuffle
-#include <boost/ref.hpp>
 
 namespace map2 {
 
@@ -138,7 +138,7 @@ namespace map2 {
                 if ( m_nThreadNo & 1 ) {
                     for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
                         for ( key_array::const_iterator it = arr.begin(), itEnd = arr.end(); it != itEnd; ++it ) {
-                            if ( rMap.insert_key( *it, cds::ref(func) ) )
+                            if ( rMap.insert_key( *it, std::ref(func) ) )
                                 ++m_nInsertSuccess;
                             else
                                 ++m_nInsertFailed;
@@ -148,7 +148,7 @@ namespace map2 {
                 else {
                     for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
                         for ( key_array::const_reverse_iterator it = arr.rbegin(), itEnd = arr.rend(); it != itEnd; ++it ) {
-                            if ( rMap.insert_key( *it, cds::ref(func) ) )
+                            if ( rMap.insert_key( *it, std::ref(func) ) )
                                 ++m_nInsertSuccess;
                             else
                                 ++m_nInsertFailed;
@@ -239,7 +239,7 @@ namespace map2 {
                     for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
                         for ( key_array::const_iterator it = arr.begin(), itEnd = arr.end(); it != itEnd; ++it ) {
                         //for ( size_t nItem = 0; nItem < c_nMapSize; ++nItem ) {
-                            std::pair<bool, bool> ret = rMap.ensure( *it, cds::ref( func ) );
+                            std::pair<bool, bool> ret = rMap.ensure( *it, std::ref( func ) );
                             if ( ret.first  ) {
                                 if ( ret.second )
                                     ++m_nEnsureCreated;
@@ -255,7 +255,7 @@ namespace map2 {
                     for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
                         for ( key_array::const_reverse_iterator it = arr.rbegin(), itEnd = arr.rend(); it != itEnd; ++it ) {
                         //for ( size_t nItem = c_nMapSize; nItem > 0; --nItem ) {
-                            std::pair<bool, bool> ret = rMap.ensure( *it, cds::ref( func ) );
+                            std::pair<bool, bool> ret = rMap.ensure( *it, std::ref( func ) );
                             if ( ret.first  ) {
                                 if ( ret.second )
                                     ++m_nEnsureCreated;
@@ -360,7 +360,7 @@ namespace map2 {
                     for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
                         for ( key_array::const_iterator it = arr.begin(), itEnd = arr.end(); it != itEnd; ++it ) {
                             func.m_cnt.nKeyExpected = *it;
-                            if ( rMap.erase( *it, cds::ref(func) ))
+                            if ( rMap.erase( *it, std::ref(func) ))
                                 ++m_nDeleteSuccess;
                             else
                                 ++m_nDeleteFailed;
@@ -371,7 +371,7 @@ namespace map2 {
                     for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
                         for ( key_array::const_reverse_iterator it = arr.rbegin(), itEnd = arr.rend(); it != itEnd; ++it ) {
                             func.m_cnt.nKeyExpected = *it;
-                            if ( rMap.erase( *it, cds::ref(func) ))
+                            if ( rMap.erase( *it, std::ref(func) ))
                                 ++m_nDeleteSuccess;
                             else
                                 ++m_nDeleteFailed;
index e635e68814942d8835db93b55fd79495b511c849..6140f45d4b36750fa2b1e69906052b02757f8e92 100644 (file)
@@ -4,7 +4,7 @@
 #define __CDSUNIT_STD_HASH_MAP_GCC_H
 
 #include <unordered_map>
-#include <cds/ref.h>
+#include <functional>   // ref
 
 namespace map2 {
 
@@ -53,7 +53,7 @@ namespace map2 {
             AutoLock al( m_lock );
             std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type(key, Value() ));
             if ( pRet.second ) {
-                cds::unref(func)( pRet.first->second, val );
+                func( pRet.first->second, val );
                 return true;
             }
             return false;
@@ -65,11 +65,11 @@ namespace map2 {
             AutoLock al( m_lock );
             std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type( key, Value() ));
             if ( pRet.second ) {
-                cds::unref(func)( true, *pRet.first );
+                func( true, *pRet.first );
                 return std::make_pair( true, true );
             }
             else {
-                cds::unref(func)( false, *pRet.first );
+                func( false, *pRet.first );
                 return std::make_pair( true, false );
             }
         }
@@ -86,7 +86,7 @@ namespace map2 {
             AutoLock al( m_lock );
             typename base_class::iterator it = base_class::find( key );
             if ( it != base_class::end() ) {
-                cds::unref(func)( *it );
+                func( *it );
                 return base_class::erase( key ) != 0;
             }
             return false;
index 69b64d2acc0a8c8a905c19d0c52672ccd4063edf..5e9c8c8b9cff4fcd25f9adf4fad406e906b7914d 100644 (file)
@@ -4,7 +4,7 @@
 #define __CDSUNIT_STD_HASH_MAP_VC_H
 
 #include <hash_map>
-#include <cds/ref.h>
+#include <functional>   // ref
 
 namespace map2 {
     template <typename Key, typename Value, typename Lock, class Alloc = CDS_DEFAULT_ALLOCATOR>
@@ -40,7 +40,7 @@ namespace map2 {
             AutoLock al( m_lock );
             std::pair<base_class::iterator, bool> pRet = base_class::insert( base_class::value_type(key, Value() ));
             if ( pRet.second ) {
-                cds::unref(func)( pRet.first->second, val );
+                func( pRet.first->second, val );
                 return true;
             }
             return false;
@@ -52,11 +52,11 @@ namespace map2 {
             AutoLock al( m_lock );
             std::pair<base_class::iterator, bool> pRet = base_class::insert( base_class::value_type(key, Value() ));
             if ( pRet.second ) {
-                cds::unref(func)( true, *pRet.first );
+                func( true, *pRet.first );
                 return std::make_pair( true, true );
             }
             else {
-                cds::unref(func)( false, *pRet.first );
+                func( false, *pRet.first );
                 return std::make_pair( true, false );
             }
         }
@@ -73,7 +73,7 @@ namespace map2 {
             AutoLock al( m_lock );
             base_class::iterator it = base_class::find( key );
             if ( it != base_class::end() ) {
-                cds::unref(func)( *it );
+                func( *it );
                 return base_class::erase( key ) != 0;
             }
             return false;
index 0f2cedfe792c62cce1a5862e5ca18ac3412c39c4..67c3d698135b1d64ae7c35099316125a7ff449b1 100644 (file)
@@ -4,7 +4,7 @@
 #define __CDSUNIT_STD_MAP_GCC_H
 
 #include <map>
-#include <cds/ref.h>
+#include <functional>   // ref
 
 namespace map2 {
 
@@ -42,7 +42,7 @@ namespace map2 {
             AutoLock al( m_lock );
             std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type(key, Value() ));
             if ( pRet.second ) {
-                cds::unref(func)( pRet.first->second, val );
+                func( pRet.first->second, val );
                 return true;
             }
             return false;
@@ -54,11 +54,11 @@ namespace map2 {
             AutoLock al( m_lock );
             std::pair<typename base_class::iterator, bool> pRet = base_class::insert( typename base_class::value_type(key, Value() ));
             if ( pRet.second ) {
-                cds::unref(func)( true, *pRet.first );
+                func( true, *pRet.first );
                 return std::make_pair( true, true );
             }
             else {
-                cds::unref(func)( false, *pRet.first );
+                func( false, *pRet.first );
                 return std::make_pair( true, false );
             }
         }
@@ -75,7 +75,7 @@ namespace map2 {
             AutoLock al( m_lock );
             typename base_class::iterator it = base_class::find( key );
             if ( it != base_class::end() ) {
-                cds::unref(func)( (*it) );
+                func( (*it) );
                 base_class::erase( it );
                 return true;
             }
index dc2b78a63f2d5251a6a51a37df5c0140349cc759..655b4d8060d479f2aeb63a96355bc7e77a90245b 100644 (file)
@@ -4,7 +4,7 @@
 #define __CDSUNIT_STD_MAP_VC_H
 
 #include <map>
-#include <cds/ref.h>
+#include <functional>   // ref
 
 namespace map2 {
     template <typename Key, typename Value, typename Lock, class Alloc = CDS_DEFAULT_ALLOCATOR>
@@ -39,7 +39,7 @@ namespace map2 {
             AutoLock al( m_lock );
             std::pair<base_class::iterator, bool> pRet = base_class::insert( base_class::value_type(key, Value() ));
             if ( pRet.second ) {
-                cds::unref(func)( pRet.first->second, val );
+                func( pRet.first->second, val );
                 return true;
             }
             return false;
@@ -51,11 +51,11 @@ namespace map2 {
             AutoLock al( m_lock );
             std::pair<base_class::iterator, bool> pRet = base_class::insert( base_class::value_type(key, Value() ));
             if ( pRet.second ) {
-                cds::unref(func)( true, *pRet.first );
+                func( true, *pRet.first );
                 return std::make_pair( true, true );
             }
             else {
-                cds::unref(func)( false, *pRet.first );
+                func( false, *pRet.first );
                 return std::make_pair( true, false );
             }
         }
@@ -72,7 +72,7 @@ namespace map2 {
             AutoLock al( m_lock );
             base_class::iterator it = base_class::find( key );
             if ( it != base_class::end() ) {
-                cds::unref(func)( *it );
+                func( *it );
 
                 base_class::erase( it );
                 return true;
index 999bae050e2ccc5bb66595d4bd41f59a798756b1..11f6bfbcddd6ecb968466542bade3650206fee67 100644 (file)
@@ -1,11 +1,12 @@
 //$$CDS-header$$
 
+#include <functional>
+#include <vector>
+
 #include "set2/set_types.h"
 #include "cppunit/thread.h"
 
 #include <cds/lock/spinlock.h>
-#include <vector>
-#include <boost/ref.hpp>
 
 namespace set2 {
 
@@ -140,7 +141,7 @@ namespace set2 {
                 if ( m_nThreadNo & 1 ) {
                     for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
                         for ( size_t * p = pKeyFirst; p < pKeyLast; ++p ) {
-                            if ( rSet.insert( *p, cds::ref(func) ) )
+                            if ( rSet.insert( *p, std::ref(func) ) )
                                 ++m_nInsertSuccess;
                             else
                                 ++m_nInsertFailed;
@@ -150,7 +151,7 @@ namespace set2 {
                 else {
                     for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
                         for ( size_t * p = pKeyLast - 1; p >= pKeyFirst; --p ) {
-                            if ( rSet.insert( *p, cds::ref(func) ) )
+                            if ( rSet.insert( *p, std::ref(func) ) )
                                 ++m_nInsertSuccess;
                             else
                                 ++m_nInsertFailed;
@@ -245,7 +246,7 @@ namespace set2 {
                 if ( m_nThreadNo & 1 ) {
                     for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
                         for ( size_t * p = pKeyFirst; p < pKeyLast; ++p ) {
-                            std::pair<bool, bool> ret = rSet.ensure( *p, cds::ref( func ) );
+                            std::pair<bool, bool> ret = rSet.ensure( *p, std::ref( func ) );
                             if ( ret.first  ) {
                                 if ( ret.second )
                                     ++m_nEnsureCreated;
@@ -260,7 +261,7 @@ namespace set2 {
                 else {
                     for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
                         for ( size_t * p = pKeyLast - 1 ; p >= pKeyFirst; --p ) {
-                            std::pair<bool, bool> ret = rSet.ensure( *p, cds::ref( func ) );
+                            std::pair<bool, bool> ret = rSet.ensure( *p, std::ref( func ) );
                             if ( ret.first  ) {
                                 if ( ret.second )
                                     ++m_nEnsureCreated;
@@ -371,7 +372,7 @@ namespace set2 {
                     for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
                         for ( size_t * p = pKeyFirst; p < pKeyLast; ++p ) {
                             func.m_cnt.nKeyExpected = *p;
-                            if ( rSet.erase( *p, cds::ref(func) ))
+                            if ( rSet.erase( *p, std::ref(func) ))
                                 ++m_nDeleteSuccess;
                             else
                                 ++m_nDeleteFailed;
@@ -382,7 +383,7 @@ namespace set2 {
                     for ( size_t nPass = 0; nPass < c_nThreadPassCount; ++nPass ) {
                         for ( size_t * p = pKeyLast - 1; p >= pKeyFirst; --p ) {
                             func.m_cnt.nKeyExpected = *p;
-                            if ( rSet.erase( *p, cds::ref(func) ))
+                            if ( rSet.erase( *p, std::ref(func) ))
                                 ++m_nDeleteSuccess;
                             else
                                 ++m_nDeleteFailed;
index 0053c838f376bae75f8d864574bd2f0814ddd586..fca8b853e79f47d3f8ef55024f425510519e00b6 100644 (file)
@@ -4,7 +4,7 @@
 #define __CDSUNIT_STD_HASH_SET_STD_H
 
 #include <unordered_set>
-#include <cds/ref.h>
+#include <functional>   // ref
 
 namespace set2 {
 
@@ -55,7 +55,7 @@ namespace set2 {
             AutoLock al( m_lock );
             std::pair<typename base_class::iterator, bool> pRet = base_class::insert( value_type( key ));
             if ( pRet.second ) {
-                cds::unref(func)( *pRet.first );
+                func( *pRet.first );
                 return true;
             }
             return false;
@@ -67,11 +67,11 @@ namespace set2 {
             AutoLock al( m_lock );
             std::pair<typename base_class::iterator, bool> pRet = base_class::insert( value_type( key ));
             if ( pRet.second ) {
-                cds::unref(func)( true, *pRet.first, key );
+                func( true, *pRet.first, key );
                 return std::make_pair( true, true );
             }
             else {
-                cds::unref(func)( false, *pRet.first, key );
+                func( false, *pRet.first, key );
                 return std::make_pair( true, false );
             }
         }
@@ -89,7 +89,7 @@ namespace set2 {
             AutoLock al( m_lock );
             typename base_class::iterator it = base_class::find( value_type(key) );
             if ( it != base_class::end() ) {
-                cds::unref(func)( *it );
+                func( *it );
                 return base_class::erase( it ) != base_class::end();
             }
             return false;
index 91dfa1899590bca19598743b087787f44ff622d1..7282ce03c1367ed29b1aa4e39cca4d53c963d539 100644 (file)
@@ -4,7 +4,6 @@
 #define __CDSUNIT_STD_HASH_SET_VC_H
 
 #include <hash_set>
-//#include <cds/ref.h>
 
 namespace set2 {
 
@@ -58,7 +57,7 @@ namespace set2 {
             AutoLock al( m_lock );
             std::pair<base_class::iterator, bool> pRet = base_class::insert( value_type( key ));
             if ( pRet.second ) {
-                cds::unref(func)( *pRet.first );
+                func( *pRet.first );
                 return true;
             }
             return false;
@@ -70,11 +69,11 @@ namespace set2 {
             AutoLock al( m_lock );
             std::pair<typename base_class::iterator, bool> pRet = base_class::insert( value_type( key ));
             if ( pRet.second ) {
-                cds::unref(func)( true, *pRet.first, key );
+                func( true, *pRet.first, key );
                 return std::make_pair( true, true );
             }
             else {
-                cds::unref(func)( false, *pRet.first, key );
+                func( false, *pRet.first, key );
                 return std::make_pair( true, false );
             }
         }
@@ -92,7 +91,7 @@ namespace set2 {
             AutoLock al( m_lock );
             base_class::iterator it = base_class::find( key );
             if ( it != base_class::end() ) {
-                cds::unref(func)( *it );
+                func( *it );
                 return base_class::erase( it ) != base_class::end();
             }
             return false;
index 7ca8660d0a95de85e6a60b59684e32efd8dcb98e..2f55586c358be6cb2e557ddb9d1f092254d93b4b 100644 (file)
@@ -4,7 +4,7 @@
 #define __CDSUNIT_STD_SET_VC_H
 
 #include <set>
-#include <cds/ref.h>
+#include <functional>   // ref
 
 namespace set2 {
     template <typename Value, typename Less, typename Lock,
@@ -41,7 +41,7 @@ namespace set2 {
             AutoLock al( m_lock );
             std::pair<typename base_class::iterator, bool> pRet = base_class::insert( value_type( key ));
             if ( pRet.second ) {
-                cds::unref(func)( *pRet.first );
+                func( *pRet.first );
                 return true;
             }
             return false;
@@ -53,11 +53,11 @@ namespace set2 {
             AutoLock al( m_lock );
             std::pair<typename base_class::iterator, bool> pRet = base_class::insert( value_type( key ));
             if ( pRet.second ) {
-                cds::unref(func)( true, *pRet.first, key );
+                func( true, *pRet.first, key );
                 return std::make_pair( true, true );
             }
             else {
-                cds::unref(func)( false, *pRet.first, key );
+                func( false, *pRet.first, key );
                 return std::make_pair( true, false );
             }
         }
@@ -75,7 +75,7 @@ namespace set2 {
             AutoLock al( m_lock );
             typename base_class::iterator it = base_class::find( value_type(key) );
             if ( it != base_class::end() ) {
-                cds::unref(func)( *it );
+                func( *it );
 
                 base_class::erase( it );
                 return true;