From 1503681e52c392bee2329cf66c910be0f8640105 Mon Sep 17 00:00:00 2001 From: khizmax Date: Sun, 28 Sep 2014 18:30:55 +0400 Subject: [PATCH] Replace cds::ref/boost::ref with std::ref, remove cds::unref and cds/ref.h header --- cds/container/basket_queue.h | 7 ++- cds/container/cuckoo_map.h | 18 +++---- cds/container/cuckoo_set.h | 24 ++++----- cds/container/details/make_split_list_set.h | 8 +-- cds/container/ellen_bintree_map_rcu.h | 18 +++---- cds/container/ellen_bintree_set_rcu.h | 24 ++++----- cds/container/impl/ellen_bintree_map.h | 18 +++---- cds/container/impl/ellen_bintree_set.h | 24 ++++----- cds/container/impl/lazy_kvlist.h | 16 +++--- cds/container/impl/lazy_list.h | 16 +++--- cds/container/impl/michael_kvlist.h | 16 +++--- cds/container/impl/michael_list.h | 16 +++--- cds/container/impl/skip_list_map.h | 18 +++---- cds/container/impl/skip_list_set.h | 24 ++++----- cds/container/lazy_kvlist_nogc.h | 6 +-- cds/container/lazy_kvlist_rcu.h | 16 +++--- cds/container/lazy_list_rcu.h | 18 +++---- cds/container/michael_kvlist_nogc.h | 6 +-- cds/container/michael_kvlist_rcu.h | 16 +++--- cds/container/michael_list_rcu.h | 16 +++--- cds/container/michael_map.h | 6 +-- cds/container/michael_map_nogc.h | 2 +- cds/container/michael_map_rcu.h | 6 +-- cds/container/michael_set.h | 8 +-- cds/container/michael_set_rcu.h | 8 +-- cds/container/moir_queue.h | 6 +-- cds/container/mspriority_queue.h | 4 +- cds/container/msqueue.h | 6 +-- cds/container/optimistic_queue.h | 6 +-- cds/container/rwqueue.h | 6 +-- cds/container/segmented_queue.h | 6 +-- cds/container/skip_list_map_nogc.h | 4 +- cds/container/skip_list_map_rcu.h | 18 +++---- cds/container/skip_list_set_rcu.h | 24 ++++----- cds/container/split_list_map.h | 12 ++--- cds/container/split_list_map_nogc.h | 4 +- cds/container/split_list_map_rcu.h | 12 ++--- cds/container/split_list_set.h | 20 +++---- cds/container/split_list_set_rcu.h | 20 +++---- cds/container/striped_map.h | 10 ++-- cds/container/striped_map/boost_list.h | 20 +++---- cds/container/striped_map/boost_slist.h | 18 +++---- cds/container/striped_map/std_hash_map_std.h | 8 +-- cds/container/striped_map/std_hash_map_vc.h | 8 +-- cds/container/striped_map/std_list.h | 18 +++---- cds/container/striped_map/std_map.h | 8 +-- cds/container/striped_set.h | 8 +-- cds/container/striped_set/adapter.h | 22 ++++---- cds/container/striped_set/boost_list.h | 18 +++---- cds/container/striped_set/boost_slist.h | 16 +++--- .../striped_set/boost_stable_vector.h | 26 ++++----- cds/container/striped_set/boost_vector.h | 20 +++---- cds/container/striped_set/std_hash_set_std.h | 8 +-- cds/container/striped_set/std_hash_set_vc.h | 8 +-- cds/container/striped_set/std_list.h | 18 +++---- cds/container/striped_set/std_set.h | 8 +-- cds/container/striped_set/std_vector.h | 18 +++---- cds/container/tsigas_cycle_queue.h | 4 +- cds/container/vyukov_mpmc_cycle_queue.h | 6 +-- cds/details/functor_wrapper.h | 2 +- cds/intrusive/basket_queue.h | 2 +- cds/intrusive/cuckoo_set.h | 28 +++++----- cds/intrusive/details/lazy_list_base.h | 2 +- cds/intrusive/details/michael_list_base.h | 2 +- cds/intrusive/details/michael_set_base.h | 2 +- cds/intrusive/ellen_bintree_rcu.h | 22 ++++---- cds/intrusive/impl/ellen_bintree.h | 22 ++++---- cds/intrusive/impl/lazy_list.h | 18 +++---- cds/intrusive/impl/michael_list.h | 18 +++---- cds/intrusive/impl/skip_list.h | 22 ++++---- cds/intrusive/lazy_list_nogc.h | 14 ++--- cds/intrusive/lazy_list_rcu.h | 18 +++---- cds/intrusive/michael_list_nogc.h | 14 ++--- cds/intrusive/michael_list_rcu.h | 18 +++---- cds/intrusive/michael_set.h | 8 +-- cds/intrusive/michael_set_nogc.h | 6 +-- cds/intrusive/michael_set_rcu.h | 8 +-- cds/intrusive/mspriority_queue.h | 4 +- cds/intrusive/optimistic_queue.h | 2 +- cds/intrusive/skip_list_nogc.h | 16 +++--- cds/intrusive/skip_list_rcu.h | 22 ++++---- cds/intrusive/split_list.h | 10 ++-- cds/intrusive/split_list_nogc.h | 8 +-- cds/intrusive/split_list_rcu.h | 10 ++-- cds/intrusive/striped_set.h | 8 +-- cds/intrusive/striped_set/adapter.h | 18 +++---- cds/intrusive/striped_set/boost_list.h | 12 ++--- cds/intrusive/striped_set/boost_slist.h | 12 ++--- .../striped_set/boost_unordered_set.h | 12 ++--- cds/intrusive/treiber_stack.h | 2 +- cds/intrusive/tsigas_cycle_queue.h | 6 +-- cds/intrusive/vyukov_mpmc_cycle_queue.h | 4 +- cds/ref.h | 54 ------------------- tests/test-hdr/map/hdr_cuckoo_map.h | 28 +++++----- tests/test-hdr/map/hdr_map.h | 28 +++++----- tests/test-hdr/map/hdr_striped_map.h | 54 +++++++++---------- tests/test-hdr/ordered_list/hdr_lazy.h | 16 +++--- tests/test-hdr/ordered_list/hdr_lazy_kv.h | 30 +++++------ tests/test-hdr/ordered_list/hdr_michael.h | 16 +++--- tests/test-hdr/ordered_list/hdr_michael_kv.h | 30 +++++------ .../priority_queue/hdr_intrusive_pqueue.h | 4 +- tests/test-hdr/priority_queue/hdr_pqueue.h | 4 +- tests/test-hdr/queue/hdr_segmented_queue.h | 6 +-- tests/test-hdr/set/hdr_cuckoo_set.h | 24 ++++----- tests/test-hdr/set/hdr_intrusive_set.h | 12 ++--- .../test-hdr/set/hdr_intrusive_skiplist_set.h | 2 +- tests/test-hdr/set/hdr_set.h | 24 ++++----- tests/test-hdr/set/hdr_striped_set.h | 46 ++++++++-------- tests/test-hdr/tree/hdr_ellenbintree_map.h | 28 +++++----- tests/test-hdr/tree/hdr_ellenbintree_set.h | 26 ++++----- tests/unit/map2/map_insdel_func.cpp | 14 ++--- tests/unit/map2/std_hash_map_gcc.h | 10 ++-- tests/unit/map2/std_hash_map_vc.h | 10 ++-- tests/unit/map2/std_map_gcc.h | 10 ++-- tests/unit/map2/std_map_vc.h | 10 ++-- tests/unit/set2/set_insdel_func.h | 17 +++--- tests/unit/set2/std_hash_set_std.h | 10 ++-- tests/unit/set2/std_hash_set_vc9.h | 9 ++-- tests/unit/set2/std_set.h | 10 ++-- 119 files changed, 811 insertions(+), 866 deletions(-) delete mode 100644 cds/ref.h diff --git a/cds/container/basket_queue.h b/cds/container/basket_queue.h index 2c67bca3..db3604a8 100644 --- a/cds/container/basket_queue.h +++ b/cds/container/basket_queue.h @@ -4,12 +4,11 @@ #define __CDS_CONTAINER_BASKET_QUEUE_H #include +#include // ref #include #include -#include #include - 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; diff --git a/cds/container/cuckoo_map.h b/cds/container/cuckoo_map.h index 7cffae9b..a6043b0a 100644 --- a/cds/container/cuckoo_map.h +++ b/cds/container/cuckoo_map.h @@ -507,7 +507,7 @@ namespace cds { namespace container { - item.first is a const reference to item's key that cannot be changed. - item.second is a reference to item's value that may be changed. - The user-defined functor can be passed by reference using boost::ref + 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 boost::ref. + You may pass \p func argument by reference using \p std::ref Returns std::pair 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 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() ); 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 boost::ref 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 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(), - [&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 diff --git a/cds/container/cuckoo_set.h b/cds/container/cuckoo_set.h index 5f2bf3ef..605f2a43 100644 --- a/cds/container/cuckoo_set.h +++ b/cds/container/cuckoo_set.h @@ -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 boost::ref + using \p std::ref */ template 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 boost::ref. + You can pass \p func argument by value or by reference using \p std::ref Returns std::pair 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 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() ); 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 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(), - [&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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 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(), - [&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 diff --git a/cds/container/details/make_split_list_set.h b/cds/container/details/make_split_list_set.h index 630f821f..fce37e08 100644 --- a/cds/container/details/make_split_list_set.h +++ b/cds/container/details/make_split_list_set.h @@ -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 @@ -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 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 diff --git a/cds/container/ellen_bintree_map_rcu.h b/cds/container/ellen_bintree_map_rcu.h index 3da55942..3ac34c43 100644 --- a/cds/container/ellen_bintree_map_rcu.h +++ b/cds/container/ellen_bintree_map_rcu.h @@ -213,7 +213,7 @@ namespace cds { namespace container { - item.first is a const reference to item's key that cannot be changed. - item.second is a reference to item's value that may be changed. - The user-defined functor can be passed by reference using boost::ref + 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 boost::ref. + 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 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 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 boost::ref 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 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 diff --git a/cds/container/ellen_bintree_set_rcu.h b/cds/container/ellen_bintree_set_rcu.h index 96788e52..405acc9e 100644 --- a/cds/container/ellen_bintree_set_rcu.h +++ b/cds/container/ellen_bintree_set_rcu.h @@ -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 boost::ref + 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 boost::ref. + 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 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 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 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 diff --git a/cds/container/impl/ellen_bintree_map.h b/cds/container/impl/ellen_bintree_map.h index 028f5d65..e3e35ce1 100644 --- a/cds/container/impl/ellen_bintree_map.h +++ b/cds/container/impl/ellen_bintree_map.h @@ -210,7 +210,7 @@ namespace cds { namespace container { - item.first is a const reference to item's key that cannot be changed. - item.second is a reference to item's value that may be changed. - The user-defined functor can be passed by reference using boost::ref + 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 boost::ref. + You may pass \p func argument by reference using \p std::ref. Returns std::pair 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 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 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 boost::ref 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 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 diff --git a/cds/container/impl/ellen_bintree_set.h b/cds/container/impl/ellen_bintree_set.h index e47739db..632b2b78 100644 --- a/cds/container/impl/ellen_bintree_set.h +++ b/cds/container/impl/ellen_bintree_set.h @@ -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 boost::ref + using \p std::ref */ template 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 boost::ref. + You may pass \p func argument by reference using \p std::ref. Returns std::pair 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 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 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 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 diff --git a/cds/container/impl/lazy_kvlist.h b/cds/container/impl/lazy_kvlist.h index f4265bde..3fc36447 100644 --- a/cds/container/impl/lazy_kvlist.h +++ b/cds/container/impl/lazy_kvlist.h @@ -4,7 +4,7 @@ #define __CDS_CONTAINER_IMPL_LAZY_KVLIST_H #include -#include +#include // ref #include #include @@ -417,7 +417,7 @@ namespace cds { namespace container { to the list's item inserted. item.second 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 boost::ref + 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 boost::ref. + You may pass \p func argument by reference using \p std::ref. Returns std::pair 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 boost::ref or cds::ref. + You may pass \p f argument by reference using \p std::ref. The functor may change item.second 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 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(node.m_Data)); }); + return base_class::erase_at( &refHead, key, cmp, [&f](node_type const & node){f( const_cast(node.m_Data)); }); } template @@ -797,7 +797,7 @@ namespace cds { namespace container { scoped_node_ptr pNode( alloc_node( key )); std::pair 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 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 diff --git a/cds/container/impl/lazy_list.h b/cds/container/impl/lazy_list.h index 57777ddd..783e08d7 100644 --- a/cds/container/impl/lazy_list.h +++ b/cds/container/impl/lazy_list.h @@ -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 boost::ref + 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 boost::ref. + You may pass \p func argument by reference using \p std::ref Returns std::pair 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 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 @@ -794,7 +794,7 @@ namespace cds { namespace container { scoped_node_ptr pNode( alloc_node( key )); std::pair 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 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 diff --git a/cds/container/impl/michael_kvlist.h b/cds/container/impl/michael_kvlist.h index d9dffc90..cd50086f 100644 --- a/cds/container/impl/michael_kvlist.h +++ b/cds/container/impl/michael_kvlist.h @@ -4,7 +4,7 @@ #define __CDS_CONTAINER_IMPL_MICHAEL_KVLIST_H #include -#include +#include // ref #include #include @@ -396,7 +396,7 @@ namespace cds { namespace container { to the list's item inserted. item.second 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 boost::ref + 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 boost::ref. + You may pass \p func argument by reference using \p std::ref Returns std::pair 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 boost::ref or cds::ref. + You may pass \p f argument by reference using \p std::ref The functor may change item.second 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 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 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(node.m_Data)); }); + return base_class::erase_at( refHead, key, cmp, [&f]( node_type const & node ){ f( const_cast(node.m_Data)); }); } template bool extract_at( head_type& refHead, typename gc::Guard& dest, K const& key, Compare cmp ) @@ -797,7 +797,7 @@ namespace cds { namespace container { template 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 diff --git a/cds/container/impl/michael_list.h b/cds/container/impl/michael_list.h index 4bbf0193..7ef71ec7 100644 --- a/cds/container/impl/michael_list.h +++ b/cds/container/impl/michael_list.h @@ -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 boost::ref + 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 boost::ref. + You may pass \p func argument by reference by \p std::ref Returns std::pair 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 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 @@ -766,7 +766,7 @@ namespace cds { namespace container { scoped_node_ptr pNode( alloc_node( key )); std::pair 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 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 diff --git a/cds/container/impl/skip_list_map.h b/cds/container/impl/skip_list_map.h index dd5e7851..6ad9a185 100644 --- a/cds/container/impl/skip_list_map.h +++ b/cds/container/impl/skip_list_map.h @@ -274,7 +274,7 @@ namespace cds { namespace container { - item.first is a const reference to item's key that cannot be changed. - item.second is a reference to item's value that may be changed. - The user-defined functor can be passed by reference using boost::ref + 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 boost::ref. + You may pass \p func argument by reference using \p std::ref Returns std::pair 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 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 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 boost::ref 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 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 diff --git a/cds/container/impl/skip_list_set.h b/cds/container/impl/skip_list_set.h index f4a89c95..783bc862 100644 --- a/cds/container/impl/skip_list_set.h +++ b/cds/container/impl/skip_list_set.h @@ -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 boost::ref + using \p std::ref */ template 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 boost::ref. + You may pass \p func argument by reference using \p std::ref Returns std::pair 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 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 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 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 diff --git a/cds/container/lazy_kvlist_nogc.h b/cds/container/lazy_kvlist_nogc.h index f05fc444..f698242a 100644 --- a/cds/container/lazy_kvlist_nogc.h +++ b/cds/container/lazy_kvlist_nogc.h @@ -387,7 +387,7 @@ namespace cds { namespace container { to the list's item inserted. item.second 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 boost::ref + 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 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 diff --git a/cds/container/lazy_kvlist_rcu.h b/cds/container/lazy_kvlist_rcu.h index 10d47ae4..c93b2d39 100644 --- a/cds/container/lazy_kvlist_rcu.h +++ b/cds/container/lazy_kvlist_rcu.h @@ -4,10 +4,10 @@ #define __CDS_CONTAINER_LAZY_KVLIST_RCU_H #include +#include // ref #include #include #include -#include #include namespace cds { namespace container { @@ -398,7 +398,7 @@ namespace cds { namespace container { to the list's item inserted. item.second 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 boost::ref + 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 boost::ref. + 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 boost::ref or cds::ref. + You may pass \p f argument by reference using \p std::ref. The functor may change item.second 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 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(node.m_Data)); }); + return base_class::erase_at( &refHead, key, cmp, [&f](node_type const & node){f( const_cast(node.m_Data)); }); } template @@ -800,7 +800,7 @@ namespace cds { namespace container { scoped_node_ptr pNode( alloc_node( key )); std::pair 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 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 diff --git a/cds/container/lazy_list_rcu.h b/cds/container/lazy_list_rcu.h index 745273f0..a3ff3e55 100644 --- a/cds/container/lazy_list_rcu.h +++ b/cds/container/lazy_list_rcu.h @@ -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 boost::ref + 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 boost::ref. + 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 find 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 boost::ref 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 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 @@ -817,7 +817,7 @@ namespace cds { namespace container { scoped_node_ptr pNode( alloc_node( key )); std::pair 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 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 diff --git a/cds/container/michael_kvlist_nogc.h b/cds/container/michael_kvlist_nogc.h index bae83d1b..b098279a 100644 --- a/cds/container/michael_kvlist_nogc.h +++ b/cds/container/michael_kvlist_nogc.h @@ -370,7 +370,7 @@ namespace cds { namespace container { to the list's item inserted. item.second 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 boost::ref + 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 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 diff --git a/cds/container/michael_kvlist_rcu.h b/cds/container/michael_kvlist_rcu.h index aaf03ae7..679c6485 100644 --- a/cds/container/michael_kvlist_rcu.h +++ b/cds/container/michael_kvlist_rcu.h @@ -4,10 +4,10 @@ #define __CDS_CONTAINER_MICHAEL_KVLIST_RCU_H #include +#include // ref #include #include #include -#include #include namespace cds { namespace container { @@ -379,7 +379,7 @@ namespace cds { namespace container { to the list's item inserted. item.second 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 boost::ref + 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 boost::ref. + 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 boost::ref or cds::ref. + You may pass \p f argument by reference using \p std::ref. The functor may change item.second 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 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 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(node.m_Data)); }); + return base_class::erase_at( refHead, key, cmp, [&f]( node_type const & node ){ f( const_cast(node.m_Data)); }); } template @@ -804,7 +804,7 @@ namespace cds { namespace container { template 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 diff --git a/cds/container/michael_list_rcu.h b/cds/container/michael_list_rcu.h index e7b0c09f..40010e87 100644 --- a/cds/container/michael_list_rcu.h +++ b/cds/container/michael_list_rcu.h @@ -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 boost::ref + 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 boost::ref. + 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 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 @@ -781,7 +781,7 @@ namespace cds { namespace container { scoped_node_ptr pNode( alloc_node( key )); std::pair 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 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 diff --git a/cds/container/michael_map.h b/cds/container/michael_map.h index 6f4a387e..791492a7 100644 --- a/cds/container/michael_map.h +++ b/cds/container/michael_map.h @@ -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 boost::ref + 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 boost::ref. + You may pass \p func argument by reference using \p std::ref Returns std::pair 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 boost::ref 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. diff --git a/cds/container/michael_map_nogc.h b/cds/container/michael_map_nogc.h index 20a3e98a..44f50b58 100644 --- a/cds/container/michael_map_nogc.h +++ b/cds/container/michael_map_nogc.h @@ -342,7 +342,7 @@ namespace cds { namespace container { to the map's item inserted. item.second 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 boost::ref + 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. diff --git a/cds/container/michael_map_rcu.h b/cds/container/michael_map_rcu.h index 02e88613..a4205a1b 100644 --- a/cds/container/michael_map_rcu.h +++ b/cds/container/michael_map_rcu.h @@ -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 boost::ref + 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 boost::ref. + 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 boost::ref 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. diff --git a/cds/container/michael_set.h b/cds/container/michael_set.h index 18e8a7b7..49627a99 100644 --- a/cds/container/michael_set.h +++ b/cds/container/michael_set.h @@ -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 boost::ref + using \p std::ref */ template 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 boost::ref. + You may pass \p func argument by reference using \p std::ref Returns std::pair 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 find function argument. - You may pass \p f argument by reference using boost::ref 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. diff --git a/cds/container/michael_set_rcu.h b/cds/container/michael_set_rcu.h index 9001e37f..279081b3 100644 --- a/cds/container/michael_set_rcu.h +++ b/cds/container/michael_set_rcu.h @@ -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 boost::ref + 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 boost::ref. + 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 find function argument. - You may pass \p f argument by reference using boost::ref 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. diff --git a/cds/container/moir_queue.h b/cds/container/moir_queue.h index b2cdeb63..38ac55d2 100644 --- a/cds/container/moir_queue.h +++ b/cds/container/moir_queue.h @@ -4,10 +4,10 @@ #define __CDS_CONTAINER_MOIR_QUEUE_H #include +#include // ref #include #include #include -#include #include 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 ); diff --git a/cds/container/mspriority_queue.h b/cds/container/mspriority_queue.h index dda777f1..c47a9306 100644 --- a/cds/container/mspriority_queue.h +++ b/cds/container/mspriority_queue.h @@ -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 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 diff --git a/cds/container/msqueue.h b/cds/container/msqueue.h index c144bdb5..4368c1ca 100644 --- a/cds/container/msqueue.h +++ b/cds/container/msqueue.h @@ -4,9 +4,9 @@ #define __CDS_CONTAINER_MSQUEUE_H #include +#include // ref #include #include -#include #include 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 ); diff --git a/cds/container/optimistic_queue.h b/cds/container/optimistic_queue.h index 4ee76da3..bfe5e078 100644 --- a/cds/container/optimistic_queue.h +++ b/cds/container/optimistic_queue.h @@ -4,9 +4,9 @@ #define __CDS_CONTAINER_OPTIMISTIC_QUEUE_H #include +#include // ref #include #include -#include #include 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 ); diff --git a/cds/container/rwqueue.h b/cds/container/rwqueue.h index 4b687dc9..b63d2ad0 100644 --- a/cds/container/rwqueue.h +++ b/cds/container/rwqueue.h @@ -4,12 +4,12 @@ #define __CDS_CONTAINER_RWQUEUE_H #include +#include // ref #include #include #include #include #include -#include 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; diff --git a/cds/container/segmented_queue.h b/cds/container/segmented_queue.h index ed5ad020..f5c506c8 100644 --- a/cds/container/segmented_queue.h +++ b/cds/container/segmented_queue.h @@ -4,9 +4,9 @@ #define __CDS_CONTAINER_SEGMENTED_QUEUE_H #include +#include // ref #include #include -#include 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; } diff --git a/cds/container/skip_list_map_nogc.h b/cds/container/skip_list_map_nogc.h index 76644e65..e4146eb9 100644 --- a/cds/container/skip_list_map_nogc.h +++ b/cds/container/skip_list_map_nogc.h @@ -238,7 +238,7 @@ namespace cds { namespace container { to the map's item inserted. item.second 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 boost::ref + 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; } diff --git a/cds/container/skip_list_map_rcu.h b/cds/container/skip_list_map_rcu.h index cc8b9919..213c2fb5 100644 --- a/cds/container/skip_list_map_rcu.h +++ b/cds/container/skip_list_map_rcu.h @@ -282,7 +282,7 @@ namespace cds { namespace container { - item.first is a const reference to item's key that cannot be changed. - item.second is a reference to item's value that may be changed. - The user-defined functor can be passed by reference using boost::ref + 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 boost::ref. + 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 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 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 boost::ref 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 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 diff --git a/cds/container/skip_list_set_rcu.h b/cds/container/skip_list_set_rcu.h index 632f2f9d..1af003d6 100644 --- a/cds/container/skip_list_set_rcu.h +++ b/cds/container/skip_list_set_rcu.h @@ -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 boost::ref + 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 boost::ref. + 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 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 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 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 diff --git a/cds/container/split_list_map.h b/cds/container/split_list_map.h index eb8442c2..c1ba53d8 100644 --- a/cds/container/split_list_map.h +++ b/cds/container/split_list_map.h @@ -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 boost::ref + 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 boost::ref. + You may pass \p func argument by reference using \p std::ref Returns std::pair 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 boost::ref 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 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(), - [&f](value_type& pair, K const&){ cds::unref(f)( pair ); } ); + [&f](value_type& pair, K const&){ f( pair ); } ); } /// Finds the key \p key diff --git a/cds/container/split_list_map_nogc.h b/cds/container/split_list_map_nogc.h index f7cbac3b..6df9038a 100644 --- a/cds/container/split_list_map_nogc.h +++ b/cds/container/split_list_map_nogc.h @@ -184,7 +184,7 @@ namespace cds { namespace container { to the map's item inserted. item.second 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 boost::ref + 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; } diff --git a/cds/container/split_list_map_rcu.h b/cds/container/split_list_map_rcu.h index cc94b742..c0a59c18 100644 --- a/cds/container/split_list_map_rcu.h +++ b/cds/container/split_list_map_rcu.h @@ -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 boost::ref + 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 boost::ref. + 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 boost::ref 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 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(), - [&f](value_type& pair, K const&){ cds::unref(f)( pair ); } ); + [&f](value_type& pair, K const&){ f( pair ); } ); } /// Finds the key \p key diff --git a/cds/container/split_list_set.h b/cds/container/split_list_set.h index ebbf6a0b..901067d3 100644 --- a/cds/container/split_list_set.h +++ b/cds/container/split_list_set.h @@ -172,14 +172,14 @@ namespace cds { namespace container { template 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 bool find_with_( Q& val, Less pred, Func f ) { return base_class::find_with( val, typename maker::template predicate_wrapper::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 @@ -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 boost::ref + using \p std::ref */ template 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 boost::ref. + You may pass \p func argument by reference using \p std::ref Returns std::pair 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 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 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::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 find function argument. - You may pass \p f argument by reference using boost::ref 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 find function argument. - You may pass \p f argument by reference using boost::ref 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. diff --git a/cds/container/split_list_set_rcu.h b/cds/container/split_list_set_rcu.h index 43101c4d..4c4fc592 100644 --- a/cds/container/split_list_set_rcu.h +++ b/cds/container/split_list_set_rcu.h @@ -217,14 +217,14 @@ namespace cds { namespace container { template 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 bool find_with_( Q& val, Less pred, Func f ) { return base_class::find_with( val, typename maker::template predicate_wrapper::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 boost::ref + 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 boost::ref. + 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 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 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::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 find function argument. - You may pass \p f argument by reference using boost::ref 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 find function argument. - You may pass \p f argument by reference using boost::ref 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. diff --git a/cds/container/striped_map.h b/cds/container/striped_map.h index 892225cb..6bfa8838 100644 --- a/cds/container/striped_map.h +++ b/cds/container/striped_map.h @@ -622,7 +622,7 @@ template - item.first is a const reference to item's key that cannot be changed. - item.second is a reference to item's value that may be changed. - The user-defined functor can be passed by reference using boost::ref + 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 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 boost::ref. + You may pass \p func argument by reference using \p std::ref Returns std::pair 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 \endcode where \p item is the item found. - You can pass \p f argument by reference using boost::ref 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 template 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 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 diff --git a/cds/container/striped_map/boost_list.h b/cds/container/striped_map/boost_list.h index 4869777e..26e44095 100644 --- a/cds/container/striped_map/boost_list.h +++ b/cds/container/striped_map/boost_list.h @@ -8,11 +8,11 @@ # error "For boost::container::list you must use boost 1.48 or above" #endif -#include -#include -#include +#include // ref #include // std::lower_bound #include // std::pair +#include +#include //@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; } diff --git a/cds/container/striped_map/boost_slist.h b/cds/container/striped_map/boost_slist.h index 7ac83a89..87740a42 100644 --- a/cds/container/striped_map/boost_slist.h +++ b/cds/container/striped_map/boost_slist.h @@ -8,10 +8,10 @@ # error "For boost::container::slist you must use boost 1.48 or above" #endif +#include // ref +#include // std::pair #include -#include #include -#include // 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; } diff --git a/cds/container/striped_map/std_hash_map_std.h b/cds/container/striped_map/std_hash_map_std.h index 58a8166c..8738c912 100644 --- a/cds/container/striped_map/std_hash_map_std.h +++ b/cds/container/striped_map/std_hash_map_std.h @@ -110,7 +110,7 @@ namespace cds { namespace intrusive { namespace striped_set { { std::pair res = m_Map.insert( value_type( key, mapped_type() )); if ( res.second ) - ::cds::unref(f)( const_cast(*res.first) ); + ::f( const_cast(*res.first) ); return res.second; } @@ -125,7 +125,7 @@ namespace cds { namespace intrusive { namespace striped_set { std::pair ensure( const Q& key, Func func ) { std::pair res = m_Map.insert( value_type( key, mapped_type() ) ); - cds::unref(func)( res.second, const_cast(*res.first)); + func( res.second, const_cast(*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(*it) ); + ::f( const_cast(*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(*it), val ); + ::f( const_cast(*it), val ); return true; } diff --git a/cds/container/striped_map/std_hash_map_vc.h b/cds/container/striped_map/std_hash_map_vc.h index 8850c6e0..81360899 100644 --- a/cds/container/striped_map/std_hash_map_vc.h +++ b/cds/container/striped_map/std_hash_map_vc.h @@ -111,7 +111,7 @@ namespace cds { namespace intrusive { namespace striped_set { { std::pair 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 ensure( const Q& val, Func func ) { std::pair 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; } diff --git a/cds/container/striped_map/std_list.h b/cds/container/striped_map/std_list.h index 914dacba..826fedcb 100644 --- a/cds/container/striped_map/std_list.h +++ b/cds/container/striped_map/std_list.h @@ -3,11 +3,11 @@ #ifndef __CDS_CONTAINER_STRIPED_MAP_STD_LIST_ADAPTER_H #define __CDS_CONTAINER_STRIPED_MAP_STD_LIST_ADAPTER_H -#include -#include #include +#include // ref #include // std::lower_bound #include // std::pair +#include //@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; } diff --git a/cds/container/striped_map/std_map.h b/cds/container/striped_map/std_map.h index 80810f42..6214b588 100644 --- a/cds/container/striped_map/std_map.h +++ b/cds/container/striped_map/std_map.h @@ -106,7 +106,7 @@ namespace cds { namespace intrusive { namespace striped_set { { std::pair 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 ensure( const Q& key, Func func ) { std::pair 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; } diff --git a/cds/container/striped_set.h b/cds/container/striped_set.h index 8c82d5be..18147ba5 100644 --- a/cds/container/striped_set.h +++ b/cds/container/striped_set.h @@ -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 boost::ref + using \p std::ref */ template 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 boost::ref. + You can pass \p func argument by value or by reference using \p std::ref Returns std::pair 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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. diff --git a/cds/container/striped_set/adapter.h b/cds/container/striped_set/adapter.h index 3367678e..fb2a34e6 100644 --- a/cds/container/striped_set/adapter.h +++ b/cds/container/striped_set/adapter.h @@ -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 boost::ref + using \p std::ref
Inserts data of type \ref value_type constructed with std::forward(args)... @@ -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 boost::ref. + You can pass \p func argument by reference using \p std::ref Returns std::pair 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 find function argument. - You can pass \p f argument by reference using boost::ref 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 res = m_Set.insert( value_type(val) ); if ( res.second ) - cds::unref(f)( const_cast(*res.first) ); + f( const_cast(*res.first) ); return res.second; } @@ -281,7 +281,7 @@ namespace cds { namespace container { std::pair ensure( const Q& val, Func func ) { std::pair res = m_Set.insert( value_type(val) ); - cds::unref(func)( res.second, const_cast(*res.first), val ); + func( res.second, const_cast(*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(*it) ); + f( const_cast(*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(*it), val ); + f( const_cast(*it), val ); return true; } @@ -403,7 +403,7 @@ namespace cds { namespace container { { std::pair 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 ensure( const Q& val, Func func ) { std::pair 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; } diff --git a/cds/container/striped_set/boost_list.h b/cds/container/striped_set/boost_list.h index 8dad1316..399f68d3 100644 --- a/cds/container/striped_set/boost_list.h +++ b/cds/container/striped_set/boost_list.h @@ -8,10 +8,10 @@ # error "For boost::container::list you must use boost 1.48 or above" #endif +#include // std::lower_bound +#include // ref #include -#include #include -#include // 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; } diff --git a/cds/container/striped_set/boost_slist.h b/cds/container/striped_set/boost_slist.h index baa8468b..18097cae 100644 --- a/cds/container/striped_set/boost_slist.h +++ b/cds/container/striped_set/boost_slist.h @@ -3,8 +3,8 @@ #ifndef __CDS_CONTAINER_STRIPED_SET_BOOST_SLIST_ADAPTER_H #define __CDS_CONTAINER_STRIPED_SET_BOOST_SLIST_ADAPTER_H +#include // ref #include -#include #include //@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; } diff --git a/cds/container/striped_set/boost_stable_vector.h b/cds/container/striped_set/boost_stable_vector.h index 77537881..9a8b8062 100644 --- a/cds/container/striped_set/boost_stable_vector.h +++ b/cds/container/striped_set/boost_stable_vector.h @@ -8,11 +8,11 @@ # error "For boost::container::stable_vector you must use boost 1.48 or above" #endif -#include -#include -#include +#include // ref #include // std::lower_bound #include // std::pair +#include +#include //@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 boost::ref + using \p std::ref */ template 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 boost::ref. + You may pass \p func argument by reference using \p std::ref Returns std::pair 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 find function argument. - You may pass \p f argument by reference using boost::ref 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; } diff --git a/cds/container/striped_set/boost_vector.h b/cds/container/striped_set/boost_vector.h index a9fbfe9d..52db5eca 100644 --- a/cds/container/striped_set/boost_vector.h +++ b/cds/container/striped_set/boost_vector.h @@ -8,11 +8,11 @@ # error "For boost::container::vector you must use boost 1.48 or above" #endif -#include // lower_bound -#include -#include +#include // ref #include // std::lower_bound #include // std::pair +#include // lower_bound +#include //@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; } diff --git a/cds/container/striped_set/std_hash_set_std.h b/cds/container/striped_set/std_hash_set_std.h index e0254c9c..72cb3fc1 100644 --- a/cds/container/striped_set/std_hash_set_std.h +++ b/cds/container/striped_set/std_hash_set_std.h @@ -93,7 +93,7 @@ namespace cds { namespace intrusive { namespace striped_set { { std::pair res = m_Set.insert( value_type(val) ); if ( res.second ) - ::cds::unref(f)( const_cast(*res.first) ); + ::f( const_cast(*res.first) ); return res.second; } @@ -108,7 +108,7 @@ namespace cds { namespace intrusive { namespace striped_set { std::pair ensure( const Q& val, Func func ) { std::pair res = m_Set.insert( value_type(val) ); - cds::unref(func)( res.second, const_cast(*res.first), val ); + func( res.second, const_cast(*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(*it) ); + f( const_cast(*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(*it), val ); + f( const_cast(*it), val ); return true; } diff --git a/cds/container/striped_set/std_hash_set_vc.h b/cds/container/striped_set/std_hash_set_vc.h index 352e30e8..765a0698 100644 --- a/cds/container/striped_set/std_hash_set_vc.h +++ b/cds/container/striped_set/std_hash_set_vc.h @@ -95,7 +95,7 @@ namespace cds { namespace intrusive { namespace striped_set { { std::pair 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 ensure( const Q& val, Func func ) { std::pair 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; } diff --git a/cds/container/striped_set/std_list.h b/cds/container/striped_set/std_list.h index 50411b06..8399f04e 100644 --- a/cds/container/striped_set/std_list.h +++ b/cds/container/striped_set/std_list.h @@ -3,10 +3,10 @@ #ifndef __CDS_CONTAINER_STRIPED_SET_STD_LIST_ADAPTER_H #define __CDS_CONTAINER_STRIPED_SET_STD_LIST_ADAPTER_H -#include -#include +#include // ref #include #include // std::lower_bound +#include //@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; } diff --git a/cds/container/striped_set/std_set.h b/cds/container/striped_set/std_set.h index 6f237946..b64c5cdc 100644 --- a/cds/container/striped_set/std_set.h +++ b/cds/container/striped_set/std_set.h @@ -90,7 +90,7 @@ namespace cds { namespace intrusive { namespace striped_set { { std::pair res = m_Set.insert( value_type(val) ); if ( res.second ) - ::cds::unref(f)( const_cast(*res.first) ); + ::f( const_cast(*res.first) ); return res.second; } @@ -105,7 +105,7 @@ namespace cds { namespace intrusive { namespace striped_set { std::pair ensure( const Q& val, Func func ) { std::pair res = m_Set.insert( value_type(val) ); - ::cds::unref(func)( res.second, const_cast(*res.first), val ); + ::func( res.second, const_cast(*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(*it) ); + ::f( const_cast(*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(*it), val ); + ::f( const_cast(*it), val ); return true; } diff --git a/cds/container/striped_set/std_vector.h b/cds/container/striped_set/std_vector.h index e1e9169f..1e19993b 100644 --- a/cds/container/striped_set/std_vector.h +++ b/cds/container/striped_set/std_vector.h @@ -3,11 +3,11 @@ #ifndef __CDS_CONTAINER_STRIPED_SET_STD_VECTOR_ADAPTER_H #define __CDS_CONTAINER_STRIPED_SET_STD_VECTOR_ADAPTER_H -#include // lower_bound -#include +#include // ref #include #include // std::lower_bound #include // std::pair +#include // 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; } diff --git a/cds/container/tsigas_cycle_queue.h b/cds/container/tsigas_cycle_queue.h index 96388898..cf09e502 100644 --- a/cds/container/tsigas_cycle_queue.h +++ b/cds/container/tsigas_cycle_queue.h @@ -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; } diff --git a/cds/container/vyukov_mpmc_cycle_queue.h b/cds/container/vyukov_mpmc_cycle_queue.h index 1d7aa899..2c2a7bf9 100644 --- a/cds/container/vyukov_mpmc_cycle_queue.h +++ b/cds/container/vyukov_mpmc_cycle_queue.h @@ -3,11 +3,11 @@ #ifndef __CDS_CONTAINER_VYUKOV_MPMC_CYCLE_QUEUE_H #define __CDS_CONTAINER_VYUKOV_MPMC_CYCLE_QUEUE_H +#include // ref #include #include #include #include -#include #include #include @@ -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 ); diff --git a/cds/details/functor_wrapper.h b/cds/details/functor_wrapper.h index a8ca972f..3ee34fcc 100644 --- a/cds/details/functor_wrapper.h +++ b/cds/details/functor_wrapper.h @@ -3,7 +3,7 @@ #ifndef __CDS_DETAILS_FUNCTOR_WRAPPER_H #define __CDS_DETAILS_FUNCTOR_WRAPPER_H -#include +#include // ref //@cond namespace cds { namespace details { diff --git a/cds/intrusive/basket_queue.h b/cds/intrusive/basket_queue.h index c556e816..46f2ca0a 100644 --- a/cds/intrusive/basket_queue.h +++ b/cds/intrusive/basket_queue.h @@ -4,11 +4,11 @@ #define __CDS_INTRUSIVE_BASKET_QUEUE_H #include +#include // ref #include #include #include #include -#include #include namespace cds { namespace intrusive { diff --git a/cds/intrusive/cuckoo_set.h b/cds/intrusive/cuckoo_set.h index 87404c7a..6815bb7a 100644 --- a/cds/intrusive/cuckoo_set.h +++ b/cds/intrusive/cuckoo_set.h @@ -6,11 +6,11 @@ #include #include #include +#include // ref #include #include #include #include -#include #include #include #include @@ -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 boost::ref + using \p std::ref */ template 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 boost::ref or cds::ref. + You may pass \p func argument by reference using \p std::ref. Returns std::pair 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 find function argument. - You can pass \p f argument by reference using boost::ref 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 find function argument. - You can pass \p f argument by reference using boost::ref 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. diff --git a/cds/intrusive/details/lazy_list_base.h b/cds/intrusive/details/lazy_list_base.h index bb181f9e..340d8027 100644 --- a/cds/intrusive/details/lazy_list_base.h +++ b/cds/intrusive/details/lazy_list_base.h @@ -3,10 +3,10 @@ #ifndef __CDS_INTRUSIVE_DETAILS_LAZY_LIST_BASE_H #define __CDS_INTRUSIVE_DETAILS_LAZY_LIST_BASE_H +#include // ref #include #include #include -#include #include #include #include diff --git a/cds/intrusive/details/michael_list_base.h b/cds/intrusive/details/michael_list_base.h index 696b200a..bd556f3a 100644 --- a/cds/intrusive/details/michael_list_base.h +++ b/cds/intrusive/details/michael_list_base.h @@ -4,11 +4,11 @@ #define __CDS_INTRUSIVE_DETAILS_MICHAEL_LIST_BASE_H #include +#include // ref #include #include #include #include -#include #include #include diff --git a/cds/intrusive/details/michael_set_base.h b/cds/intrusive/details/michael_set_base.h index 5792f7f1..2fb5a06b 100644 --- a/cds/intrusive/details/michael_set_base.h +++ b/cds/intrusive/details/michael_set_base.h @@ -3,12 +3,12 @@ #ifndef __CDS_INTRUSIVE_DETAILS_MICHAEL_SET_BASE_H #define __CDS_INTRUSIVE_DETAILS_MICHAEL_SET_BASE_H +#include // ref #include #include #include #include #include -#include namespace cds { namespace intrusive { diff --git a/cds/intrusive/ellen_bintree_rcu.h b/cds/intrusive/ellen_bintree_rcu.h index e7029da4..abb9fa70 100644 --- a/cds/intrusive/ellen_bintree_rcu.h +++ b/cds/intrusive/ellen_bintree_rcu.h @@ -4,9 +4,9 @@ #define __CDS_INTRUSIVE_ELLEN_BINTREE_RCU_H #include +#include // ref #include #include -#include #include #include #include @@ -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 boost::ref + 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 boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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; diff --git a/cds/intrusive/impl/ellen_bintree.h b/cds/intrusive/impl/ellen_bintree.h index 039114ff..407b2e18 100644 --- a/cds/intrusive/impl/ellen_bintree.h +++ b/cds/intrusive/impl/ellen_bintree.h @@ -4,9 +4,9 @@ #define __CDS_INTRUSIVE_IMPL_ELLEN_BINTREE_H #include +#include // ref #include #include -#include #include #include #include @@ -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 boost::ref + using \p std::ref */ template 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 boost::ref or cds::ref. + You can pass \p func argument by value or by reference using \p std::ref. Returns std::pair 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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; diff --git a/cds/intrusive/impl/lazy_list.h b/cds/intrusive/impl/lazy_list.h index 943232d6..c0d64a96 100644 --- a/cds/intrusive/impl/lazy_list.h +++ b/cds/intrusive/impl/lazy_list.h @@ -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 boost::ref. + using \p std::ref */ template 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 boost::ref or cds::ref. + You may pass \p func argument by reference using \p std::ref. Returns std::pair 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 boost::ref 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; } } diff --git a/cds/intrusive/impl/michael_list.h b/cds/intrusive/impl/michael_list.h index da5fba53..43addd16 100644 --- a/cds/intrusive/impl/michael_list.h +++ b/cds/intrusive/impl/michael_list.h @@ -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 boost::ref. + using \p std::ref */ template 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 boost::ref or cds::ref. + You may pass \p func argument by reference using \p std::ref. Returns std::pair 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 find function argument. - You may pass \p f argument by reference using boost::ref 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; diff --git a/cds/intrusive/impl/skip_list.h b/cds/intrusive/impl/skip_list.h index de43a010..c9f25594 100644 --- a/cds/intrusive/impl/skip_list.h +++ b/cds/intrusive/impl/skip_list.h @@ -5,9 +5,9 @@ #include #include +#include // ref #include #include -#include #include #include @@ -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 boost::ref + using \p std::ref */ template 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 boost::ref or cds::ref. + You can pass \p func argument by value or by reference using \p std::ref. Returns std::pair 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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. diff --git a/cds/intrusive/lazy_list_nogc.h b/cds/intrusive/lazy_list_nogc.h index c1c40a38..a50e742a 100644 --- a/cds/intrusive/lazy_list_nogc.h +++ b/cds/intrusive/lazy_list_nogc.h @@ -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 @@ -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 boost::ref or cds::ref. + You may pass \p func argument by reference using \p std::ref. Returns std::pair 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 find function argument. - You may pass \p f argument by reference using boost::ref 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; } } diff --git a/cds/intrusive/lazy_list_rcu.h b/cds/intrusive/lazy_list_rcu.h index c20ccda4..43ddce46 100644 --- a/cds/intrusive/lazy_list_rcu.h +++ b/cds/intrusive/lazy_list_rcu.h @@ -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 boost::ref. + using \p std::ref. */ template 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 boost::ref or cds::ref. + You may pass \p func argument by reference using \p std::ref. Returns std::pair 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 find function argument. - You may pass \p f argument by reference using boost::ref 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 find function argument. - You may pass \p f argument by reference using boost::ref 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; } } diff --git a/cds/intrusive/michael_list_nogc.h b/cds/intrusive/michael_list_nogc.h index 6f0ace51..89a5ae6b 100644 --- a/cds/intrusive/michael_list_nogc.h +++ b/cds/intrusive/michael_list_nogc.h @@ -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 @@ -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 boost::ref or cds::ref. + You can pass \p func argument by value or by reference using \p std::ref. Returns std::pair 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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; diff --git a/cds/intrusive/michael_list_rcu.h b/cds/intrusive/michael_list_rcu.h index f57f8172..69ab9cee 100644 --- a/cds/intrusive/michael_list_rcu.h +++ b/cds/intrusive/michael_list_rcu.h @@ -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 boost::ref. + 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 boost::ref or cds::ref. + You can pass \p func argument by value or by reference using \p std::ref. Returns std::pair 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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; diff --git a/cds/intrusive/michael_set.h b/cds/intrusive/michael_set.h index d6242b76..51ebeeb9 100644 --- a/cds/intrusive/michael_set.h +++ b/cds/intrusive/michael_set.h @@ -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 boost::ref + using \p std::ref. */ template 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 boost::ref or cds::ref. + You may pass \p func argument by reference using \p std::ref. Returns std::pair 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 find function argument. - You can pass \p f argument by reference using boost::ref 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 find function argument. - You can pass \p f argument by reference using boost::ref 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. diff --git a/cds/intrusive/michael_set_nogc.h b/cds/intrusive/michael_set_nogc.h index 59b542db..52120faf 100644 --- a/cds/intrusive/michael_set_nogc.h +++ b/cds/intrusive/michael_set_nogc.h @@ -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 boost::ref or cds::ref. + You can pass \p func argument by value or by reference using \p std::ref. Returns std::pair 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 diff --git a/cds/intrusive/michael_set_rcu.h b/cds/intrusive/michael_set_rcu.h index 7c2c80cc..18fe794f 100644 --- a/cds/intrusive/michael_set_rcu.h +++ b/cds/intrusive/michael_set_rcu.h @@ -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 boost::ref + using \p std::ref. */ template 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 boost::ref or cds::ref. + You can pass \p func argument by value or by reference using \p std::ref. Returns std::pair 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 diff --git a/cds/intrusive/mspriority_queue.h b/cds/intrusive/mspriority_queue.h index ffe3adb2..29cca936 100644 --- a/cds/intrusive/mspriority_queue.h +++ b/cds/intrusive/mspriority_queue.h @@ -3,6 +3,7 @@ #ifndef __CDS_INTRUSIVE_MSPRIORITY_QUEUE_H #define __CDS_INTRUSIVE_MSPRIORITY_QUEUE_H +#include // ref #include #include #include @@ -11,7 +12,6 @@ #include #include #include -#include 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 ); } } diff --git a/cds/intrusive/optimistic_queue.h b/cds/intrusive/optimistic_queue.h index d22c7a6a..cba41218 100644 --- a/cds/intrusive/optimistic_queue.h +++ b/cds/intrusive/optimistic_queue.h @@ -4,12 +4,12 @@ #define __CDS_INTRUSIVE_OPTIMISTIC_QUEUE_H #include +#include // ref #include #include #include #include #include -#include namespace cds { namespace intrusive { diff --git a/cds/intrusive/skip_list_nogc.h b/cds/intrusive/skip_list_nogc.h index cb1ca410..ba4ce746 100644 --- a/cds/intrusive/skip_list_nogc.h +++ b/cds/intrusive/skip_list_nogc.h @@ -5,10 +5,10 @@ #include #include +#include // ref #include #include #include -#include #include 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 boost::ref or cds::ref. + You can pass \p func argument by value or by reference using \p std::ref. Returns std::pair 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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. diff --git a/cds/intrusive/skip_list_rcu.h b/cds/intrusive/skip_list_rcu.h index 314d1700..e5d17ee8 100644 --- a/cds/intrusive/skip_list_rcu.h +++ b/cds/intrusive/skip_list_rcu.h @@ -5,9 +5,9 @@ #include #include +#include // ref #include #include -#include #include #include #include @@ -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 boost::ref + 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 boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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. diff --git a/cds/intrusive/split_list.h b/cds/intrusive/split_list.h index 2f80baa3..acab1ea3 100644 --- a/cds/intrusive/split_list.h +++ b/cds/intrusive/split_list.h @@ -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& val){ cds::unref(f)(item, val.val ); }); + [&f](value_type& item, split_list::details::search_value_type& val){ f(item, val.val ); }); } template @@ -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 boost::ref + using \p std::ref. */ template 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 boost::ref or cds::ref. + You can pass \p func argument by value or by reference using \p std::ref. Returns std::pair 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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. diff --git a/cds/intrusive/split_list_nogc.h b/cds/intrusive/split_list_nogc.h index a8550803..a6f47f13 100644 --- a/cds/intrusive/split_list_nogc.h +++ b/cds/intrusive/split_list_nogc.h @@ -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 boost::ref or cds::ref. + You can pass \p func argument by value by reference using \p std::ref. Returns std::pair 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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& val){ cds::unref(f)(item, val.val ); }); + [&f](value_type& item, split_list::details::search_value_type& val){ f(item, val.val ); }); } //@endcond diff --git a/cds/intrusive/split_list_rcu.h b/cds/intrusive/split_list_rcu.h index 315d5559..1faf970e 100644 --- a/cds/intrusive/split_list_rcu.h +++ b/cds/intrusive/split_list_rcu.h @@ -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& val){ cds::unref(f)(item, val.val ); }); + [&f](value_type& item, split_list::details::search_value_type& val){ f(item, val.val ); }); } template @@ -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 boost::ref + 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 boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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 find function argument. - You can pass \p f argument by value or by reference using boost::ref 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. diff --git a/cds/intrusive/striped_set.h b/cds/intrusive/striped_set.h index 61feae6f..4f799d3d 100644 --- a/cds/intrusive/striped_set.h +++ b/cds/intrusive/striped_set.h @@ -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 boost::ref + using \p std::ref. */ template 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 boost::ref or cds::ref. + You may pass \p func argument by reference using \p std::ref. Returns std::pair 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 find function argument. - You can pass \p f argument by reference using boost::ref 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 find function argument. - You can pass \p f argument by reference using boost::ref 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. diff --git a/cds/intrusive/striped_set/adapter.h b/cds/intrusive/striped_set/adapter.h index 8d95114b..fa18554f 100644 --- a/cds/intrusive/striped_set/adapter.h +++ b/cds/intrusive/striped_set/adapter.h @@ -3,11 +3,11 @@ #ifndef __CDS_INTRUSIVE_STRIPED_SET_ADAPTER_H #define __CDS_INTRUSIVE_STRIPED_SET_ADAPTER_H +#include // ref #include #include #include #include // cds::opt::details::make_comparator - for some adapt specializations -#include 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 boost::ref + using \p std::ref
Ensures that the \p item exists in the container @@ -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 boost::ref. + You can pass \p f argument by reference using \p std::ref Returns std::pair 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 find function argument. - You can pass \p f argument by reference using boost::ref 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 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 ensure( value_type& val, Func f ) { std::pair 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; } diff --git a/cds/intrusive/striped_set/boost_list.h b/cds/intrusive/striped_set/boost_list.h index 1bda29ae..c0b34001 100644 --- a/cds/intrusive/striped_set/boost_list.h +++ b/cds/intrusive/striped_set/boost_list.h @@ -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; } diff --git a/cds/intrusive/striped_set/boost_slist.h b/cds/intrusive/striped_set/boost_slist.h index 8edced68..65680fea 100644 --- a/cds/intrusive/striped_set/boost_slist.h +++ b/cds/intrusive/striped_set/boost_slist.h @@ -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; } diff --git a/cds/intrusive/striped_set/boost_unordered_set.h b/cds/intrusive/striped_set/boost_unordered_set.h index f4a8fb3c..b2009b2f 100644 --- a/cds/intrusive/striped_set/boost_unordered_set.h +++ b/cds/intrusive/striped_set/boost_unordered_set.h @@ -77,7 +77,7 @@ namespace cds { namespace intrusive { namespace striped_set { { std::pair 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 ensure( value_type& val, Func f ) { std::pair 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(pred) ); if ( it == m_Set.end() ) return false; - cds::unref(f)( *it, key ); + f( *it, key ); return true; } diff --git a/cds/intrusive/treiber_stack.h b/cds/intrusive/treiber_stack.h index 48d17919..09b03c3e 100644 --- a/cds/intrusive/treiber_stack.h +++ b/cds/intrusive/treiber_stack.h @@ -4,8 +4,8 @@ #define __CDS_INTRUSIVE_TREIBER_STACK_H #include +#include // ref #include -#include #include #include #include diff --git a/cds/intrusive/tsigas_cycle_queue.h b/cds/intrusive/tsigas_cycle_queue.h index 5d6108ca..f9bbb360 100644 --- a/cds/intrusive/tsigas_cycle_queue.h +++ b/cds/intrusive/tsigas_cycle_queue.h @@ -3,11 +3,11 @@ #ifndef __CDS_INTRUSIVE_TSIGAS_CYCLE_QUEUE_H #define __CDS_INTRUSIVE_TSIGAS_CYCLE_QUEUE_H +#include // ref #include #include #include #include -#include 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 @@ -351,7 +351,7 @@ namespace cds { namespace intrusive { { value_type * pv; while ( (pv = pop()) != nullptr ) { - unref(f)( pv ); + f( pv ); } } diff --git a/cds/intrusive/vyukov_mpmc_cycle_queue.h b/cds/intrusive/vyukov_mpmc_cycle_queue.h index 165cdb46..03382df3 100644 --- a/cds/intrusive/vyukov_mpmc_cycle_queue.h +++ b/cds/intrusive/vyukov_mpmc_cycle_queue.h @@ -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 @@ -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 index d03650ee..00000000 --- a/cds/ref.h +++ /dev/null @@ -1,54 +0,0 @@ -//$$CDS-header$$ - -#ifndef __CDS_REF_H -#define __CDS_REF_H - -#include -#include - -//@cond -namespace cds { - - using boost::ref; - - namespace details { - template - struct unwrap_reference - { - typedef T type; - static T apply(T f) - { - return f; - } - }; - - template - struct unwrap_reference - { - typedef T& type; - static T& apply( T& f ) - { - return f; - } - }; - - template - struct unwrap_reference > - { - typedef T& type; - static T& apply( boost::reference_wrapper f ) - { - return f.get(); - } - }; - } - - template - static inline typename details::unwrap_reference::type unref( T f ) - { - return cds::details::unwrap_reference::apply(f); - } -} -//@endcond - -#endif // #ifndef __CDS_REF_H diff --git a/tests/test-hdr/map/hdr_cuckoo_map.h b/tests/test-hdr/map/hdr_cuckoo_map.h index ccc7cfa9..40310cf7 100644 --- a/tests/test-hdr/map/hdr_cuckoo_map.h +++ b/tests/test-hdr/map/hdr_cuckoo_map.h @@ -7,7 +7,7 @@ #include "cppunit/cppunit_proxy.h" #include #include -#include +#include // ref #include // 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() ) ; // 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 )); diff --git a/tests/test-hdr/map/hdr_map.h b/tests/test-hdr/map/hdr_map.h index 08a3fa6c..e54ac4ed 100644 --- a/tests/test-hdr/map/hdr_map.h +++ b/tests/test-hdr/map/hdr_map.h @@ -7,7 +7,7 @@ #include "cppunit/cppunit_proxy.h" #include #include -#include +#include // ref #include // 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() ) ; // 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 )); diff --git a/tests/test-hdr/map/hdr_striped_map.h b/tests/test-hdr/map/hdr_striped_map.h index 352c26ef..54749027 100644 --- a/tests/test-hdr/map/hdr_striped_map.h +++ b/tests/test-hdr/map/hdr_striped_map.h @@ -7,7 +7,7 @@ #include "cppunit/cppunit_proxy.h" #include #include -#include +#include // ref #include // 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() ) ; // 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() ) ; // 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 )); diff --git a/tests/test-hdr/ordered_list/hdr_lazy.h b/tests/test-hdr/ordered_list/hdr_lazy.h index f7b9eb52..177a2d1b 100644 --- a/tests/test-hdr/ordered_list/hdr_lazy.h +++ b/tests/test-hdr/ordered_list/hdr_lazy.h @@ -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() )); - CPPUNIT_ASSERT( l.find_with( i, lt(), boost::ref(f) )); + CPPUNIT_ASSERT( l.find_with( i, lt(), 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(), cds::ref(ef) )); + CPPUNIT_ASSERT( l.erase_with( 160, lt(), std::ref(ef) )); CPPUNIT_ASSERT( ef.nEraseCall == 1 ); - CPPUNIT_ASSERT( !l.erase_with( 160, lt(), cds::ref(ef) )); + CPPUNIT_ASSERT( !l.erase_with( 160, lt(), 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 ); } diff --git a/tests/test-hdr/ordered_list/hdr_lazy_kv.h b/tests/test-hdr/ordered_list/hdr_lazy_kv.h index e800f497..f24384bb 100644 --- a/tests/test-hdr/ordered_list/hdr_lazy_kv.h +++ b/tests/test-hdr/ordered_list/hdr_lazy_kv.h @@ -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() )); CPPUNIT_ASSERT( l.insert( 50, 500 )); CPPUNIT_ASSERT( l.find_with( 50, lt() )); 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(), boost::ref( chk ) )); + CPPUNIT_ASSERT( l.find_with( 150, lt(), 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(), cds::ref(ef)) ); + CPPUNIT_ASSERT( l.erase_with( 200, lt(), 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(), boost::ref(chk) )); + CPPUNIT_ASSERT( l.find_with( i - 1, lt(), std::ref( chk ) ) ); } l.clear(); diff --git a/tests/test-hdr/ordered_list/hdr_michael.h b/tests/test-hdr/ordered_list/hdr_michael.h index 02465fc0..380ae236 100644 --- a/tests/test-hdr/ordered_list/hdr_michael.h +++ b/tests/test-hdr/ordered_list/hdr_michael.h @@ -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() )); - CPPUNIT_ASSERT( l.find_with( i, lt(), boost::ref(f) )); + CPPUNIT_ASSERT( l.find_with( i, lt(), 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(), cds::ref(ef) )); + CPPUNIT_ASSERT( l.erase_with( 160, lt(), std::ref(ef) )); CPPUNIT_ASSERT( ef.nEraseCall == 1 ); - CPPUNIT_ASSERT( !l.erase_with( 160, lt(), cds::ref(ef) )); + CPPUNIT_ASSERT( !l.erase_with( 160, lt(), 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 ); } diff --git a/tests/test-hdr/ordered_list/hdr_michael_kv.h b/tests/test-hdr/ordered_list/hdr_michael_kv.h index 263ee1ab..7aaa8c61 100644 --- a/tests/test-hdr/ordered_list/hdr_michael_kv.h +++ b/tests/test-hdr/ordered_list/hdr_michael_kv.h @@ -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() )); CPPUNIT_ASSERT( l.insert( 50, 500 )); CPPUNIT_ASSERT( l.find_with( 50, lt() )); CPPUNIT_ASSERT( !l.insert( 50, 5 )); chk.m_nExpected = 500; - CPPUNIT_ASSERT( l.find_with( 50, lt(), boost::ref( chk ) )); + CPPUNIT_ASSERT( l.find_with( 50, lt(), std::ref( chk ) ) ); chk.m_nExpected = 0; - CPPUNIT_ASSERT( l.find_with( 100, lt(), boost::ref( chk ) )); + CPPUNIT_ASSERT( l.find_with( 100, lt(), 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(), cds::ref(ef)) ); + CPPUNIT_ASSERT( l.erase_with( 200, lt(), 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(), boost::ref(chk) )); + CPPUNIT_ASSERT( l.find_with( i, lt(), std::ref( chk ) ) ); } l.clear(); diff --git a/tests/test-hdr/priority_queue/hdr_intrusive_pqueue.h b/tests/test-hdr/priority_queue/hdr_intrusive_pqueue.h index 70b86eb2..2e7f8671 100644 --- a/tests/test-hdr/priority_queue/hdr_intrusive_pqueue.h +++ b/tests/test-hdr/priority_queue/hdr_intrusive_pqueue.h @@ -6,7 +6,7 @@ #include "cppunit/cppunit_proxy.h" #include "size_check.h" #include -#include +#include // 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 ); diff --git a/tests/test-hdr/priority_queue/hdr_pqueue.h b/tests/test-hdr/priority_queue/hdr_pqueue.h index cb8025b4..70366fa4 100644 --- a/tests/test-hdr/priority_queue/hdr_pqueue.h +++ b/tests/test-hdr/priority_queue/hdr_pqueue.h @@ -6,7 +6,7 @@ #include "cppunit/cppunit_proxy.h" #include "size_check.h" #include -#include +#include // 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 ); diff --git a/tests/test-hdr/queue/hdr_segmented_queue.h b/tests/test-hdr/queue/hdr_segmented_queue.h index 633358b9..f7621ad7 100644 --- a/tests/test-hdr/queue/hdr_segmented_queue.h +++ b/tests/test-hdr/queue/hdr_segmented_queue.h @@ -5,7 +5,7 @@ #include "cppunit/cppunit_proxy.h" #include -#include +#include // 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 diff --git a/tests/test-hdr/set/hdr_cuckoo_set.h b/tests/test-hdr/set/hdr_cuckoo_set.h index 442dd7de..c3f269a0 100644 --- a/tests/test-hdr/set/hdr_cuckoo_set.h +++ b/tests/test-hdr/set/hdr_cuckoo_set.h @@ -8,7 +8,7 @@ #include #include -#include +#include // ref #include // random_shuffle // forward namespace declaration @@ -353,7 +353,7 @@ namespace set { { copy_found 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 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 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 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 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 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 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 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 ); } diff --git a/tests/test-hdr/set/hdr_intrusive_set.h b/tests/test-hdr/set/hdr_intrusive_set.h index 33f36a22..d383d861 100644 --- a/tests/test-hdr/set/hdr_intrusive_set.h +++ b/tests/test-hdr/set/hdr_intrusive_set.h @@ -4,7 +4,7 @@ #include "size_check.h" #include -#include +#include // ref #include // 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(), cds::ref(ff) )); + CPPUNIT_ASSERT( s.find_with( v3, less(), 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(), cds::ref(ff) )); + CPPUNIT_ASSERT( s.find_with( v3, less(), std::ref(ff) )); CPPUNIT_ASSERT( v3.nFindCount == 1 ); v3.nFindCount = 0; CPPUNIT_ASSERT( check_size( s, 3 )); diff --git a/tests/test-hdr/set/hdr_intrusive_skiplist_set.h b/tests/test-hdr/set/hdr_intrusive_skiplist_set.h index b7be0510..f07be30d 100644 --- a/tests/test-hdr/set/hdr_intrusive_skiplist_set.h +++ b/tests/test-hdr/set/hdr_intrusive_skiplist_set.h @@ -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 )); diff --git a/tests/test-hdr/set/hdr_set.h b/tests/test-hdr/set/hdr_set.h index c8e1e06f..0146bd13 100644 --- a/tests/test-hdr/set/hdr_set.h +++ b/tests/test-hdr/set/hdr_set.h @@ -8,7 +8,7 @@ #include #include -#include +#include // ref #include // random_shuffle // forward namespace declaration @@ -511,7 +511,7 @@ namespace set { { copy_found 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 f; 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.nFindCount == 2 ); @@ -535,7 +535,7 @@ namespace set { { copy_found 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 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 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 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 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(), 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 == 235 ); } @@ -629,17 +629,17 @@ namespace set { { copy_found 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 ); } diff --git a/tests/test-hdr/set/hdr_striped_set.h b/tests/test-hdr/set/hdr_striped_set.h index 1535615a..36d22b70 100644 --- a/tests/test-hdr/set/hdr_striped_set.h +++ b/tests/test-hdr/set/hdr_striped_set.h @@ -8,7 +8,7 @@ #include #include -#include +#include // ref #include // random_shuffle // forward namespace declaration @@ -367,7 +367,7 @@ namespace set { { copy_found 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 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 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 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 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 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 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 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 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 f; key = 20; CPPUNIT_ASSERT( s.find_with( 20, less(), 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 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 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 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 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 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(), 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 == 235 ); } @@ -677,17 +677,17 @@ namespace set { { copy_found 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 ); } diff --git a/tests/test-hdr/tree/hdr_ellenbintree_map.h b/tests/test-hdr/tree/hdr_ellenbintree_map.h index 0a20d07b..c087779c 100644 --- a/tests/test-hdr/tree/hdr_ellenbintree_map.h +++ b/tests/test-hdr/tree/hdr_ellenbintree_map.h @@ -5,7 +5,7 @@ #include "cppunit/cppunit_proxy.h" #include "size_check.h" -#include +#include // ref #include 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() ) ; // 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 )); diff --git a/tests/test-hdr/tree/hdr_ellenbintree_set.h b/tests/test-hdr/tree/hdr_ellenbintree_set.h index 06e916d4..24c11647 100644 --- a/tests/test-hdr/tree/hdr_ellenbintree_set.h +++ b/tests/test-hdr/tree/hdr_ellenbintree_set.h @@ -5,7 +5,7 @@ #include "cppunit/cppunit_proxy.h" #include "size_check.h" -#include +#include // ref #include namespace tree { @@ -302,7 +302,7 @@ namespace tree { copy_found 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 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 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 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 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 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 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 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 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 ); } diff --git a/tests/unit/map2/map_insdel_func.cpp b/tests/unit/map2/map_insdel_func.cpp index 765db471..d8a6e00c 100644 --- a/tests/unit/map2/map_insdel_func.cpp +++ b/tests/unit/map2/map_insdel_func.cpp @@ -1,12 +1,12 @@ //$$CDS-header$$ +#include #include "map2/map_types.h" #include "cppunit/thread.h" #include #include #include // random_shuffle -#include 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 ret = rMap.ensure( *it, cds::ref( func ) ); + std::pair 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 ret = rMap.ensure( *it, cds::ref( func ) ); + std::pair 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; diff --git a/tests/unit/map2/std_hash_map_gcc.h b/tests/unit/map2/std_hash_map_gcc.h index e635e688..6140f45d 100644 --- a/tests/unit/map2/std_hash_map_gcc.h +++ b/tests/unit/map2/std_hash_map_gcc.h @@ -4,7 +4,7 @@ #define __CDSUNIT_STD_HASH_MAP_GCC_H #include -#include +#include // ref namespace map2 { @@ -53,7 +53,7 @@ namespace map2 { AutoLock al( m_lock ); std::pair 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 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; diff --git a/tests/unit/map2/std_hash_map_vc.h b/tests/unit/map2/std_hash_map_vc.h index 69b64d2a..5e9c8c8b 100644 --- a/tests/unit/map2/std_hash_map_vc.h +++ b/tests/unit/map2/std_hash_map_vc.h @@ -4,7 +4,7 @@ #define __CDSUNIT_STD_HASH_MAP_VC_H #include -#include +#include // ref namespace map2 { template @@ -40,7 +40,7 @@ namespace map2 { AutoLock al( m_lock ); std::pair 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 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; diff --git a/tests/unit/map2/std_map_gcc.h b/tests/unit/map2/std_map_gcc.h index 0f2cedfe..67c3d698 100644 --- a/tests/unit/map2/std_map_gcc.h +++ b/tests/unit/map2/std_map_gcc.h @@ -4,7 +4,7 @@ #define __CDSUNIT_STD_MAP_GCC_H #include -#include +#include // ref namespace map2 { @@ -42,7 +42,7 @@ namespace map2 { AutoLock al( m_lock ); std::pair 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 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; } diff --git a/tests/unit/map2/std_map_vc.h b/tests/unit/map2/std_map_vc.h index dc2b78a6..655b4d80 100644 --- a/tests/unit/map2/std_map_vc.h +++ b/tests/unit/map2/std_map_vc.h @@ -4,7 +4,7 @@ #define __CDSUNIT_STD_MAP_VC_H #include -#include +#include // ref namespace map2 { template @@ -39,7 +39,7 @@ namespace map2 { AutoLock al( m_lock ); std::pair 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 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; diff --git a/tests/unit/set2/set_insdel_func.h b/tests/unit/set2/set_insdel_func.h index 999bae05..11f6bfbc 100644 --- a/tests/unit/set2/set_insdel_func.h +++ b/tests/unit/set2/set_insdel_func.h @@ -1,11 +1,12 @@ //$$CDS-header$$ +#include +#include + #include "set2/set_types.h" #include "cppunit/thread.h" #include -#include -#include 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 ret = rSet.ensure( *p, cds::ref( func ) ); + std::pair 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 ret = rSet.ensure( *p, cds::ref( func ) ); + std::pair 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; diff --git a/tests/unit/set2/std_hash_set_std.h b/tests/unit/set2/std_hash_set_std.h index 0053c838..fca8b853 100644 --- a/tests/unit/set2/std_hash_set_std.h +++ b/tests/unit/set2/std_hash_set_std.h @@ -4,7 +4,7 @@ #define __CDSUNIT_STD_HASH_SET_STD_H #include -#include +#include // ref namespace set2 { @@ -55,7 +55,7 @@ namespace set2 { AutoLock al( m_lock ); std::pair 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 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; diff --git a/tests/unit/set2/std_hash_set_vc9.h b/tests/unit/set2/std_hash_set_vc9.h index 91dfa189..7282ce03 100644 --- a/tests/unit/set2/std_hash_set_vc9.h +++ b/tests/unit/set2/std_hash_set_vc9.h @@ -4,7 +4,6 @@ #define __CDSUNIT_STD_HASH_SET_VC_H #include -//#include namespace set2 { @@ -58,7 +57,7 @@ namespace set2 { AutoLock al( m_lock ); std::pair 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 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; diff --git a/tests/unit/set2/std_set.h b/tests/unit/set2/std_set.h index 7ca8660d..2f55586c 100644 --- a/tests/unit/set2/std_set.h +++ b/tests/unit/set2/std_set.h @@ -4,7 +4,7 @@ #define __CDSUNIT_STD_SET_VC_H #include -#include +#include // ref namespace set2 { template 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 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; -- 2.34.1