From: khizmax Date: Tue, 23 Sep 2014 19:15:36 +0000 (+0400) Subject: Remove CDS_EMPLACE_SUPPORT macro and unused code X-Git-Tag: v2.0.0~301 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bab1583cb2db30355c138a507943cd5ad068ccf4;p=libcds.git Remove CDS_EMPLACE_SUPPORT macro and unused code --- diff --git a/cds/container/basket_queue.h b/cds/container/basket_queue.h index 4bed4452..05ccee61 100644 --- a/cds/container/basket_queue.h +++ b/cds/container/basket_queue.h @@ -41,15 +41,10 @@ namespace cds { namespace container { node_type( const value_type& val ) : m_value( val ) {} -# ifdef CDS_EMPLACE_SUPPORT template node_type( Args&&... args ) : m_value( std::forward(args)...) {} -# else - node_type() - {} -# endif }; typedef typename options::allocator::template rebind::other allocator_type; @@ -193,13 +188,11 @@ namespace cds { namespace container { { return cxx_allocator().New( val ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node_move( Args&&... args ) { return cxx_allocator().MoveNew( std::forward( args )... ); } -# endif static void free_node( node_type * p ) { node_deallocator()( p ); @@ -283,12 +276,7 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT /// Enqueues data of type \ref value_type constructed with std::forward(args)... - /** - This function is available only for compiler that supports - variadic template and move semantics - */ template bool emplace( Args&&... args ) { @@ -299,8 +287,6 @@ namespace cds { namespace container { } return false; } -# endif - /// Dequeues a value using copy functor /** diff --git a/cds/container/cuckoo_map.h b/cds/container/cuckoo_map.h index 73b65873..f9ae03c7 100644 --- a/cds/container/cuckoo_map.h +++ b/cds/container/cuckoo_map.h @@ -36,15 +36,10 @@ namespace cds { namespace container { : m_val( std::make_pair( key_type(key), mapped_type(v) )) {} -# ifdef CDS_EMPLACE_SUPPORT template node_type( K&& key, Args&&... args ) : m_val( std::forward(key), std::move( mapped_type(std::forward(args)...)) ) {} -# else - node_type() - {} -# endif }; /* @@ -356,13 +351,11 @@ namespace cds { namespace container { { return cxx_node_allocator().New( key ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( K&& key, Args&&... args ) { return cxx_node_allocator().MoveNew( std::forward( key ), std::forward(args)... ); } -# endif static void free_node( node_type * pNode ) { @@ -618,13 +611,9 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT /// For key \p key inserts data of type \ref value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. - - This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( K&& key, Args&&... args ) @@ -636,8 +625,6 @@ namespace cds { namespace container { } return false; } -# endif - /// Ensures that the \p key exists in the map /** diff --git a/cds/container/cuckoo_set.h b/cds/container/cuckoo_set.h index 6b90d127..8c24b107 100644 --- a/cds/container/cuckoo_set.h +++ b/cds/container/cuckoo_set.h @@ -28,15 +28,10 @@ namespace cds { namespace container { : m_val(v) {} -# ifdef CDS_EMPLACE_SUPPORT template node_type( Args&&... args ) : m_val( std::forward(args)...) {} -# else - node_type() - {} -# endif }; struct value_accessor { @@ -401,13 +396,11 @@ namespace cds { namespace container { { return cxx_node_allocator().New( v ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( Args&&... args ) { return cxx_node_allocator().MoveNew( std::forward(args)... ); } -# endif static void free_node( node_type * pNode ) { @@ -623,13 +616,9 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. - - This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( Args&&... args ) @@ -641,7 +630,6 @@ namespace cds { namespace container { } return false; } -# endif /// Ensures that the \p val exists in the set /** diff --git a/cds/container/details/make_lazy_kvlist.h b/cds/container/details/make_lazy_kvlist.h index 89351f75..870ab5f0 100644 --- a/cds/container/details/make_lazy_kvlist.h +++ b/cds/container/details/make_lazy_kvlist.h @@ -39,12 +39,10 @@ namespace cds { namespace container { : m_Data( key, value ) {} -# ifdef CDS_EMPLACE_SUPPORT template node_type( Ky&& key, Args&&... args ) : m_Data( std::forward(key), std::move( value_type( std::forward(args)...))) {} -# endif }; typedef typename original_type_traits::allocator::template rebind::other allocator_type; diff --git a/cds/container/details/make_lazy_list.h b/cds/container/details/make_lazy_list.h index 30b30c6f..06506c5e 100644 --- a/cds/container/details/make_lazy_list.h +++ b/cds/container/details/make_lazy_list.h @@ -28,12 +28,10 @@ namespace cds { namespace container { node_type( Q const& v ) : m_Value(v) {} -# ifdef CDS_EMPLACE_SUPPORT template node_type( Args&&... args ) : m_Value( std::forward(args)...) {} -# endif }; typedef typename original_type_traits::allocator::template rebind::other allocator_type; diff --git a/cds/container/details/make_michael_kvlist.h b/cds/container/details/make_michael_kvlist.h index 9d0bcf23..64a9d9b4 100644 --- a/cds/container/details/make_michael_kvlist.h +++ b/cds/container/details/make_michael_kvlist.h @@ -39,12 +39,10 @@ namespace cds { namespace container { : m_Data( key, value ) {} -# ifdef CDS_EMPLACE_SUPPORT template< typename Ky, typename... Args> node_type( Ky&& key, Args&&... args ) : m_Data( std::forward(key), std::move( value_type( std::forward(args)...))) {} -# endif }; typedef typename original_type_traits::allocator::template rebind::other allocator_type; diff --git a/cds/container/details/make_michael_list.h b/cds/container/details/make_michael_list.h index 8d65e28b..2c5939eb 100644 --- a/cds/container/details/make_michael_list.h +++ b/cds/container/details/make_michael_list.h @@ -28,12 +28,10 @@ namespace cds { namespace container { : m_Value(v) {} -# ifdef CDS_EMPLACE_SUPPORT template node_type( Args&&... args ) : m_Value( std::forward(args)... ) {} -# endif }; typedef Traits original_type_traits; diff --git a/cds/container/details/make_skip_list_map.h b/cds/container/details/make_skip_list_map.h index af1076fa..69c72a47 100644 --- a/cds/container/details/make_skip_list_map.h +++ b/cds/container/details/make_skip_list_map.h @@ -42,14 +42,12 @@ namespace cds { namespace container { namespace details { init_tower( nHeight, pTower ); } -# ifdef CDS_EMPLACE_SUPPORT template node_type( unsigned int nHeight, atomic_marked_ptr * pTower, Q&& key, Args&&... args ) : m_Value( std::forward(key), std::move( mapped_type( std::forward(args)... ))) { init_tower( nHeight, pTower ); } -# endif private: node_type() ; // no default ctor @@ -82,7 +80,6 @@ namespace cds { namespace container { namespace details { key, val ); } -# ifdef CDS_EMPLACE_SUPPORT template node_type * New( unsigned int nHeight, Args&&... args ) { @@ -93,7 +90,6 @@ namespace cds { namespace container { namespace details { std::forward(args)... ); } -# endif }; struct node_deallocator { diff --git a/cds/container/details/make_skip_list_set.h b/cds/container/details/make_skip_list_set.h index e88ee5c0..061d24b6 100644 --- a/cds/container/details/make_skip_list_set.h +++ b/cds/container/details/make_skip_list_set.h @@ -36,7 +36,6 @@ namespace cds { namespace container { namespace details { } } -# ifdef CDS_EMPLACE_SUPPORT template node_type( unsigned int nHeight, atomic_marked_ptr * pTower, Q&& q, Args&&... args ) : m_Value( std::forward(q), std::forward(args)... ) @@ -46,7 +45,6 @@ namespace cds { namespace container { namespace details { base_class::make_tower( nHeight, pTower ); } } -# endif private: node_type() ; // no default ctor diff --git a/cds/container/ellen_bintree_map_impl.h b/cds/container/ellen_bintree_map_impl.h index c4997548..a71b7857 100644 --- a/cds/container/ellen_bintree_map_impl.h +++ b/cds/container/ellen_bintree_map_impl.h @@ -327,13 +327,9 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT /// For key \p key inserts data of type \ref value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( K&& key, Args&&... args ) @@ -345,7 +341,6 @@ namespace cds { namespace container { } return false; } -# endif /// Ensures that the \p key exists in the map /** diff --git a/cds/container/ellen_bintree_map_rcu.h b/cds/container/ellen_bintree_map_rcu.h index 1f968d3c..4bab281a 100644 --- a/cds/container/ellen_bintree_map_rcu.h +++ b/cds/container/ellen_bintree_map_rcu.h @@ -332,15 +332,11 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT /// For key \p key inserts data of type \ref value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. RCU \p synchronize method can be called. RCU should not be locked. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( K&& key, Args&&... args ) @@ -352,7 +348,6 @@ namespace cds { namespace container { } return false; } -# endif /// Ensures that the \p key exists in the map /** diff --git a/cds/container/ellen_bintree_set_impl.h b/cds/container/ellen_bintree_set_impl.h index 90421ae0..ea2a0071 100644 --- a/cds/container/ellen_bintree_set_impl.h +++ b/cds/container/ellen_bintree_set_impl.h @@ -357,13 +357,9 @@ namespace cds { namespace container { return bRes; } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( Args&&... args ) @@ -375,7 +371,6 @@ namespace cds { namespace container { } return false; } -# endif /// Delete \p key from the set /** \anchor cds_nonintrusive_EllenBinTreeSet_erase_val diff --git a/cds/container/ellen_bintree_set_rcu.h b/cds/container/ellen_bintree_set_rcu.h index 11ea6f52..579da7a9 100644 --- a/cds/container/ellen_bintree_set_rcu.h +++ b/cds/container/ellen_bintree_set_rcu.h @@ -362,15 +362,11 @@ namespace cds { namespace container { return bRes; } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. RCU \p synchronize method can be called. RCU should not be locked. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( Args&&... args ) @@ -382,7 +378,6 @@ namespace cds { namespace container { } return false; } -# endif /// Delete \p key from the set /** \anchor cds_nonintrusive_EllenBinTreeSet_rcu_erase_val diff --git a/cds/container/lazy_kvlist_impl.h b/cds/container/lazy_kvlist_impl.h index 66179fe0..7589cbbe 100644 --- a/cds/container/lazy_kvlist_impl.h +++ b/cds/container/lazy_kvlist_impl.h @@ -216,13 +216,11 @@ namespace cds { namespace container { return cxx_allocator().New( key, val ); } -#ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( Args&&... args ) { return cxx_allocator().MoveNew( std::forward(args)... ); } -#endif static void free_node( node_type * pNode ) { @@ -504,20 +502,15 @@ namespace cds { namespace container { return insert_key_at( head(), key, func ); } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref mapped_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( Args&&... args ) { return emplace_at( head(), std::forward(args)... ); } -# endif /// Ensures that the \p key exists in the list /** @@ -846,13 +839,11 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace_at( head_type& refHead, Args&&... args ) { return insert_node_at( refHead, alloc_node( std::forward(args)... )); } -# endif template bool erase_at( head_type& refHead, K const& key, Compare cmp ) diff --git a/cds/container/lazy_kvlist_nogc.h b/cds/container/lazy_kvlist_nogc.h index d2d36e97..eba231af 100644 --- a/cds/container/lazy_kvlist_nogc.h +++ b/cds/container/lazy_kvlist_nogc.h @@ -141,13 +141,11 @@ namespace cds { namespace container { return cxx_allocator().New( key, val ); } -#ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( Args&&... args ) { return cxx_allocator().MoveNew( std::forward(args)... ); } -#endif static void free_node( node_type * pNode ) { @@ -461,20 +459,15 @@ namespace cds { namespace container { return std::make_pair( node_to_iterator( ret.first ), ret.second ); } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref mapped_type constructed with std::forward(args)... /** Returns an iterator pointed to inserted value, or \p end() if inserting is failed - - This function is available only for compiler that supports - variadic template and move semantics */ template iterator emplace( Args&&... args ) { return node_to_iterator( emplace_at( head(), std::forward(args)... )); } -# endif /// Find the key \p key /** \anchor cds_nonintrusive_LazyKVList_nogc_find @@ -587,13 +580,11 @@ namespace cds { namespace container { return std::make_pair( pItemFound, ret.second ); } -# ifdef CDS_EMPLACE_SUPPORT template node_type * emplace_at( head_type& refHead, Args&&... args ) { return insert_node_at( refHead, alloc_node( std::forward(args)... )); } -#endif template node_type * find_at( head_type& refHead, const K& key, Compare cmp ) diff --git a/cds/container/lazy_kvlist_rcu.h b/cds/container/lazy_kvlist_rcu.h index 20d2f475..6dfb17e8 100644 --- a/cds/container/lazy_kvlist_rcu.h +++ b/cds/container/lazy_kvlist_rcu.h @@ -227,13 +227,11 @@ namespace cds { namespace container { return cxx_allocator().New( key, val ); } -#ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( Args&&... args ) { return cxx_allocator().MoveNew( std::forward(args)... ); } -#endif static void free_node( node_type * pNode ) { @@ -494,22 +492,17 @@ namespace cds { namespace container { return insert_key_at( head(), key, func ); } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref mapped_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. The function makes RCU lock internally. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( Args&&... args ) { return emplace_at( head(), std::forward(args)... ); } -# endif /// Ensures that the \p key exists in the list /** @@ -862,13 +855,11 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace_at( head_type& refHead, Args&&... args ) { return insert_node_at( refHead, alloc_node( std::forward(args)... )); } -# endif template bool erase_at( head_type& refHead, K const& key, Compare cmp ) diff --git a/cds/container/lazy_list_impl.h b/cds/container/lazy_list_impl.h index 1ed6fcb0..51784f6f 100644 --- a/cds/container/lazy_list_impl.h +++ b/cds/container/lazy_list_impl.h @@ -229,13 +229,11 @@ namespace cds { namespace container { return cxx_allocator().New( v ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( Args&&... args ) { return cxx_allocator().MoveNew( std::forward(args)... ); } -# endif static void free_node( node_type * pNode ) { @@ -467,20 +465,15 @@ namespace cds { namespace container { return insert_at( head(), key, func ); } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. - - This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( Args&&... args ) { return emplace_at( head(), std::forward(args)... ); } -# endif /// Ensures that the \p key exists in the list /** @@ -842,13 +835,11 @@ namespace cds { namespace container { return insert_node_at( refHead, alloc_node( val )); } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace_at( head_type& refHead, Args&&... args ) { return insert_node_at( refHead, alloc_node( std::forward(args)... )); } -# endif template bool insert_at( head_type& refHead, const Q& key, Func f ) diff --git a/cds/container/lazy_list_nogc.h b/cds/container/lazy_list_nogc.h index 5c08d1f8..24bc1552 100644 --- a/cds/container/lazy_list_nogc.h +++ b/cds/container/lazy_list_nogc.h @@ -107,13 +107,11 @@ namespace cds { namespace container { return cxx_allocator().New( v ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( Args&&... args ) { return cxx_allocator().MoveNew( std::forward(args)... ); } -# endif static void free_node( node_type * pNode ) { @@ -323,20 +321,15 @@ namespace cds { namespace container { return node_to_iterator( insert_at( head(), val ) ); } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref value_type constructed with std::forward(args)... /** Return an iterator pointing to inserted item if success \ref end() otherwise - - This function is available only for compiler that supports - variadic template and move semantics */ template iterator emplace( Args&&... args ) { return node_to_iterator( emplace_at( head(), std::forward(args)... )); } -# endif /// Ensures that the item \p val exists in the list /** @@ -425,13 +418,12 @@ namespace cds { namespace container { return insert_node_at( refHead, alloc_node( val )); } -# ifdef CDS_EMPLACE_SUPPORT template node_type * emplace_at( head_type& refHead, Args&&... args ) { return insert_node_at( refHead, alloc_node( std::forward(args)... )); } -# endif + template std::pair< node_type *, bool > ensure_at( head_type& refHead, Q const& val ) { diff --git a/cds/container/lazy_list_rcu.h b/cds/container/lazy_list_rcu.h index e9bc4dfe..0f95f58d 100644 --- a/cds/container/lazy_list_rcu.h +++ b/cds/container/lazy_list_rcu.h @@ -240,13 +240,11 @@ namespace cds { namespace container { return cxx_allocator().New( v ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( Args&&... args ) { return cxx_allocator().MoveNew( std::forward(args)... ); } -# endif static void free_node( node_type * pNode ) { @@ -469,22 +467,17 @@ namespace cds { namespace container { return insert_at( head(), key, func ); } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. The function makes RCU lock internally. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( Args&&... args ) { return emplace_at( head(), std::forward(args)... ); } -# endif /// Ensures that the \p key exists in the list /** @@ -871,13 +864,11 @@ namespace cds { namespace container { return insert_node_at( refHead, alloc_node( val )); } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace_at( head_type& refHead, Args&&... args ) { return insert_node_at( refHead, alloc_node( std::forward(args)... )); } -# endif template bool insert_at( head_type& refHead, Q const& key, Func f ) diff --git a/cds/container/michael_kvlist_impl.h b/cds/container/michael_kvlist_impl.h index 92e31592..58926079 100644 --- a/cds/container/michael_kvlist_impl.h +++ b/cds/container/michael_kvlist_impl.h @@ -216,13 +216,11 @@ namespace cds { namespace container { return cxx_allocator().New( key, val ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( K&& key, Args&&... args ) { return cxx_allocator().MoveNew( std::forward(key), std::forward(args)...); } -# endif static void free_node( node_type * pNode ) { @@ -523,20 +521,15 @@ namespace cds { namespace container { return ensure_at( head(), key, f ); } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref mapped_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( K&& key, Args&&... args ) { return emplace_at( head(), std::forward(key), std::forward(args)... ); } -# endif /// Deletes \p key from the list /** \anchor cds_nonintrusive_MichaelKVList_hp_erase_val @@ -832,13 +825,11 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace_at( head_type& refHead, K&& key, Args&&... args ) { return insert_node_at( refHead, alloc_node( std::forward(key), std::forward(args)... )); } -# endif template std::pair ensure_at( head_type& refHead, const K& key, Func f ) diff --git a/cds/container/michael_kvlist_nogc.h b/cds/container/michael_kvlist_nogc.h index a9575b29..d9407d0c 100644 --- a/cds/container/michael_kvlist_nogc.h +++ b/cds/container/michael_kvlist_nogc.h @@ -142,13 +142,11 @@ namespace cds { namespace container { return cxx_allocator().New( key, val ); } -#ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( K&& key, Args&&... args ) { return cxx_allocator().MoveNew( std::forward(key), std::forward(args)... ); } -#endif static void free_node( node_type * pNode ) { @@ -444,20 +442,15 @@ namespace cds { namespace container { return std::make_pair( node_to_iterator( ret.first ), ret.second ); } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref mapped_type constructed with std::forward(args)... /** Returns an iterator pointed to inserted value, or \p end() if inserting is failed - - This function is available only for compiler that supports - variadic template and move semantics */ template iterator emplace( K&& key, Args&&... args ) { return node_to_iterator( emplace_at( head(), std::forward(key), std::forward(args)... )); } -# endif /// Find the key \p key /** \anchor cds_nonintrusive_MichaelKVList_nogc_find @@ -568,13 +561,11 @@ namespace cds { namespace container { return std::make_pair( pItemFound, ret.second ); } -# ifdef CDS_EMPLACE_SUPPORT template node_type * emplace_at( head_type& refHead, K&& key, Args&&... args ) { return insert_node_at( refHead, alloc_node( std::forward(key), std::forward(args)... )); } -#endif template node_type * find_at( head_type& refHead, K const& key, Compare cmp ) diff --git a/cds/container/michael_kvlist_rcu.h b/cds/container/michael_kvlist_rcu.h index e606c568..c0d2cb99 100644 --- a/cds/container/michael_kvlist_rcu.h +++ b/cds/container/michael_kvlist_rcu.h @@ -228,13 +228,11 @@ namespace cds { namespace container { return cxx_allocator().New( key, val ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( K&& key, Args&&... args ) { return cxx_allocator().MoveNew( std::forward(key), std::forward(args)...); } -# endif static void free_node( node_type * pNode ) { @@ -516,22 +514,17 @@ namespace cds { namespace container { return ensure_at( head(), key, f ); } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref mapped_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. The function makes RCU lock internally. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( K&& key, Args&&... args ) { return emplace_at( head(), std::forward(key), std::forward(args)... ); } -# endif /// Deletes \p key from the list /** \anchor cds_nonintrusive_MichaelKVList_rcu_erase @@ -844,13 +837,11 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace_at( head_type& refHead, K&& key, Args&&... args ) { return insert_node_at( refHead, alloc_node( std::forward(key), std::forward(args)... )); } -# endif template std::pair ensure_at( head_type& refHead, const K& key, Func f ) diff --git a/cds/container/michael_list_impl.h b/cds/container/michael_list_impl.h index de789738..d139ef78 100644 --- a/cds/container/michael_list_impl.h +++ b/cds/container/michael_list_impl.h @@ -219,13 +219,11 @@ namespace cds { namespace container { return cxx_allocator().New( v ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( Args&&... args ) { return cxx_allocator().MoveNew( std::forward(args)... ); } -# endif static void free_node( node_type * pNode ) { @@ -475,20 +473,15 @@ namespace cds { namespace container { return ensure_at( head(), key, f ); } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. - - This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( Args&&... args ) { return emplace_at( head(), std::forward(args)... ); } -# endif /// Delete \p key from the list /** \anchor cds_nonintrusive_MichealList_hp_erase_val @@ -839,13 +832,11 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace_at( head_type& refHead, Args&&... args ) { return insert_node_at( refHead, alloc_node( std::forward(args) ... )); } -# endif template bool erase_at( head_type& refHead, Q const& key, Compare cmp, Func f ) diff --git a/cds/container/michael_list_nogc.h b/cds/container/michael_list_nogc.h index 41a023b0..512d6173 100644 --- a/cds/container/michael_list_nogc.h +++ b/cds/container/michael_list_nogc.h @@ -106,13 +106,11 @@ namespace cds { namespace container { return cxx_allocator().New( v ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( Args&&... args ) { return cxx_allocator().MoveNew( std::forward(args)... ); } -# endif static void free_node( node_type * pNode ) { @@ -323,20 +321,15 @@ namespace cds { namespace container { return std::make_pair( node_to_iterator( ret.first ), ret.second ); } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref value_type constructed with std::forward(args)... /** Return an iterator pointing to inserted item if success \ref end() otherwise - - This function is available only for compiler that supports - variadic template and move semantics */ template iterator emplace( Args&&... args ) { return node_to_iterator( emplace_at( head(), std::forward(args)... )); } -# endif /// Find the key \p val /** \anchor cds_nonintrusive_MichaelList_nogc_find_val @@ -429,13 +422,11 @@ namespace cds { namespace container { return std::make_pair( pItemFound, ret.second ); } -# ifdef CDS_EMPLACE_SUPPORT template node_type * emplace_at( head_type& refHead, Args&&... args ) { return insert_node_at( refHead, alloc_node( std::forward(args)...)); } -# endif template node_type * find_at( head_type& refHead, Q const& key, Compare cmp ) diff --git a/cds/container/michael_list_rcu.h b/cds/container/michael_list_rcu.h index 2ee4d7dc..6d8ba102 100644 --- a/cds/container/michael_list_rcu.h +++ b/cds/container/michael_list_rcu.h @@ -231,13 +231,11 @@ namespace cds { namespace container { return cxx_allocator().New( v ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( Args&&... args ) { return cxx_allocator().MoveNew( std::forward(args)... ); } -# endif static void free_node( node_type * pNode ) { @@ -477,22 +475,17 @@ namespace cds { namespace container { return ensure_at( head(), key, f ); } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. The function makes RCU lock internally. - - @note This function is available only for compiler that supports - variadic template and move semantics. */ template bool emplace( Args&&... args ) { return emplace_at( head(), std::forward(args)... ); } -# endif /// Deletes \p key from the list /** \anchor cds_nonintrusive_MichealList_rcu_erase_val @@ -866,13 +859,11 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace_at( head_type& refHead, Args&&... args ) { return insert_node_at( refHead, alloc_node( std::forward(args) ... )); } -# endif template bool erase_at( head_type& refHead, Q const& key, Compare cmp, Func f ) diff --git a/cds/container/michael_map.h b/cds/container/michael_map.h index 762267d3..605d6af8 100644 --- a/cds/container/michael_map.h +++ b/cds/container/michael_map.h @@ -516,15 +516,11 @@ namespace cds { namespace container { return bRet; } -# ifdef CDS_EMPLACE_SUPPORT /// For key \p key inserts data of type \p mapped_type constructed with std::forward(args)... /** \p key_type should be constructible from type \p K Returns \p true if inserting successful, \p false otherwise. - - This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( K&& key, Args&&... args ) @@ -534,7 +530,6 @@ namespace cds { namespace container { ++m_ItemCounter; return bRet; } -# endif /// Deletes \p key from the map /** \anchor cds_nonintrusive_MichaelMap_erase_val diff --git a/cds/container/michael_map_nogc.h b/cds/container/michael_map_nogc.h index 90880666..c77d7f93 100644 --- a/cds/container/michael_map_nogc.h +++ b/cds/container/michael_map_nogc.h @@ -371,15 +371,11 @@ namespace cds { namespace container { return end(); } -# ifdef CDS_EMPLACE_SUPPORT /// For key \p key inserts data of type \ref mapped_type constructed with std::forward(args)... /** \p key_type should be constructible from type \p K Returns an iterator pointed to inserted value, or \p end() if inserting is failed - - This function is available only for compiler that supports - variadic template and move semantics */ template iterator emplace( K&& key, Args&&... args ) @@ -394,7 +390,6 @@ namespace cds { namespace container { return end(); } -# endif /// Ensures that the key \p key exists in the map /** diff --git a/cds/container/michael_map_rcu.h b/cds/container/michael_map_rcu.h index d3e0510c..4df00403 100644 --- a/cds/container/michael_map_rcu.h +++ b/cds/container/michael_map_rcu.h @@ -448,17 +448,11 @@ namespace cds { namespace container { return bRet; } -# ifdef CDS_EMPLACE_SUPPORT /// For key \p key inserts data of type \ref mapped_type constructed with std::forward(args)... /** \p key_type should be constructible from type \p K Returns \p true if inserting successful, \p false otherwise. - - The function applies RCU lock internally. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( K&& key, Args&&... args ) @@ -468,7 +462,6 @@ namespace cds { namespace container { ++m_ItemCounter; return bRet; } -# endif /// Deletes \p key from the map /** \anchor cds_nonintrusive_MichaelMap_rcu_erase_val diff --git a/cds/container/michael_set.h b/cds/container/michael_set.h index 2b1ebbf6..a4155486 100644 --- a/cds/container/michael_set.h +++ b/cds/container/michael_set.h @@ -407,13 +407,9 @@ namespace cds { namespace container { return bRet; } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( Args&&... args ) @@ -423,7 +419,6 @@ namespace cds { namespace container { ++m_ItemCounter; return bRet; } -# endif /// Deletes \p key from the set /** \anchor cds_nonintrusive_MichaelSet_erase_val diff --git a/cds/container/michael_set_nogc.h b/cds/container/michael_set_nogc.h index 46b6058e..8cbe4f57 100644 --- a/cds/container/michael_set_nogc.h +++ b/cds/container/michael_set_nogc.h @@ -197,13 +197,9 @@ namespace cds { namespace container { return end(); } -#ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref value_type constructed with std::forward(args)... /** Return an iterator pointing to inserted item if success \ref end() otherwise - - This function is available only for compiler that supports - variadic template and move semantics */ template iterator emplace( Args&&... args ) @@ -218,7 +214,6 @@ namespace cds { namespace container { return end(); } -#endif /// Ensures that the item \p val exists in the set /** diff --git a/cds/container/michael_set_rcu.h b/cds/container/michael_set_rcu.h index 152fbf9b..65e08632 100644 --- a/cds/container/michael_set_rcu.h +++ b/cds/container/michael_set_rcu.h @@ -360,15 +360,11 @@ namespace cds { namespace container { return bRet; } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. The function applies RCU lock internally. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( Args&&... args ) @@ -378,7 +374,6 @@ namespace cds { namespace container { ++m_ItemCounter; return bRet; } -# endif /// Deletes \p key from the set /** \anchor cds_nonintrusive_MichealSet_rcu_erase_val diff --git a/cds/container/moir_queue.h b/cds/container/moir_queue.h index be75ba3e..f8d23811 100644 --- a/cds/container/moir_queue.h +++ b/cds/container/moir_queue.h @@ -41,15 +41,11 @@ namespace cds { namespace container { node_type( const value_type& val ) : m_value( val ) {} -# ifdef CDS_EMPLACE_SUPPORT + template node_type( Args&&... args ) : m_value( std::forward(args)...) {} -# else - node_type() - {} -# endif }; typedef typename options::allocator::template rebind::other allocator_type; @@ -137,13 +133,11 @@ namespace cds { namespace container { { return cxx_allocator().New( val ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node_move( Args&&... args ) { return cxx_allocator().MoveNew( std::forward( args )... ); } -# endif static void free_node( node_type * p ) { node_deallocator()( p ); @@ -282,12 +276,7 @@ namespace cds { namespace container { return enqueue( data, f ); } -# ifdef CDS_EMPLACE_SUPPORT /// Enqueues data of type \ref value_type constructed with std::forward(args)... - /** - This function is available only for compiler that supports - variadic template and move semantics - */ template bool emplace( Args&&... args ) { @@ -298,8 +287,6 @@ namespace cds { namespace container { } return false; } -# endif - /// Synonym for \ref dequeue function bool pop( value_type& dest ) diff --git a/cds/container/mspriority_queue.h b/cds/container/mspriority_queue.h index a451b4cd..bd3d8cec 100644 --- a/cds/container/mspriority_queue.h +++ b/cds/container/mspriority_queue.h @@ -193,16 +193,12 @@ namespace cds { namespace container { return false; } -#ifdef CDS_EMPLACE_SUPPORT /// Inserts a item into priority queue /** If the priority queue is full, the function returns \p false, no item has been added. Otherwise, the function inserts a new item created from \p args arguments into the heap and returns \p true. - - The function is available only for compilers supporting variable template - and move semantics C++11 feature. */ template bool emplace( Args&&... args ) @@ -214,7 +210,6 @@ namespace cds { namespace container { } return false; } -#endif /// Extracts item with high priority /** diff --git a/cds/container/msqueue.h b/cds/container/msqueue.h index 37f605ae..822faea3 100644 --- a/cds/container/msqueue.h +++ b/cds/container/msqueue.h @@ -39,15 +39,11 @@ namespace cds { namespace container { node_type( const value_type& val ) : m_value( val ) {} -# ifdef CDS_EMPLACE_SUPPORT + template node_type( Args&&... args ) : m_value( std::forward(args)...) {} -# else - node_type() - {} -# endif }; typedef typename options::allocator::template rebind::other allocator_type; @@ -148,13 +144,11 @@ namespace cds { namespace container { { return cxx_allocator().New( val ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node_move( Args&&... args ) { return cxx_allocator().MoveNew( std::forward( args )... ); } -# endif static void free_node( node_type * p ) { node_deallocator()( p ); @@ -306,12 +300,7 @@ namespace cds { namespace container { return dequeue( dest, f ); } -# ifdef CDS_EMPLACE_SUPPORT /// Enqueues data of type \ref value_type constructed with std::forward(args)... - /** - This function is available only for compiler that supports - variadic template and move semantics - */ template bool emplace( Args&&... args ) { @@ -322,7 +311,6 @@ namespace cds { namespace container { } return false; } -# endif /// Checks if the queue is empty bool empty() const diff --git a/cds/container/optimistic_queue.h b/cds/container/optimistic_queue.h index 93121376..85492d43 100644 --- a/cds/container/optimistic_queue.h +++ b/cds/container/optimistic_queue.h @@ -40,15 +40,11 @@ namespace cds { namespace container { node_type( value_type const& val ) : m_value( val ) {} -# ifdef CDS_EMPLACE_SUPPORT + template node_type( Args&&... args ) : m_value( std::forward(args)...) {} -# else - node_type() - {} -# endif }; typedef typename options::allocator::template rebind::other allocator_type; @@ -157,13 +153,11 @@ namespace cds { namespace container { { return cxx_allocator().New( val ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node_move( Args&&... args ) { return cxx_allocator().MoveNew( std::forward( args )... ); } -# endif static void free_node( node_type * p ) { node_deallocator()( p ); @@ -245,12 +239,7 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT /// Enqueues data of type \ref value_type constructed with std::forward(args)... - /** - This function is available only for compiler that supports - variadic template and move semantics - */ template bool emplace( Args&&... args ) { @@ -261,7 +250,6 @@ namespace cds { namespace container { } return false; } -# endif /// Dequeues a value using copy functor /** diff --git a/cds/container/rwqueue.h b/cds/container/rwqueue.h index 754ec3ed..b64d3e7e 100644 --- a/cds/container/rwqueue.h +++ b/cds/container/rwqueue.h @@ -90,13 +90,11 @@ namespace cds { namespace container { : m_pNext( nullptr ) {} -# ifdef CDS_EMPLACE_SUPPORT template node_type( Args&&... args ) : m_pNext( nullptr ) , m_value( std::forward(args)...) {} -# endif }; //@endcond @@ -132,13 +130,11 @@ namespace cds { namespace container { return node_allocator().New( data ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node_move( Args&&... args ) { return node_allocator().MoveNew( std::forward( args )... ); } -# endif static void free_node( node_type * pNode ) { @@ -225,12 +221,7 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT /// Enqueues data of type \ref value_type constructed with std::forward(args)... - /** - This function is available only for compiler that supports - variadic template and move semantics - */ template bool emplace( Args&&... args ) { @@ -241,7 +232,6 @@ namespace cds { namespace container { } return false; } -# endif /// Dequeues a value using copy functor /** diff --git a/cds/container/segmented_queue.h b/cds/container/segmented_queue.h index 3026019c..ecd0b20d 100644 --- a/cds/container/segmented_queue.h +++ b/cds/container/segmented_queue.h @@ -206,13 +206,11 @@ namespace cds { namespace container { return cxx_node_allocator().New(); } -# ifdef CDS_EMPLACE_SUPPORT template static value_type * alloc_node_move( Args&&... args ) { return cxx_node_allocator().MoveNew( std::forward( args )... ); } -# endif struct dummy_disposer { void operator()( value_type * p ) @@ -289,12 +287,7 @@ namespace cds { namespace container { return enqueue( data, f ); } -# ifdef CDS_EMPLACE_SUPPORT /// Enqueues data of type \ref value_type constructed with std::forward(args)... - /** - This function is available only for compiler that supports - variadic template and move semantics - */ template bool emplace( Args&&... args ) { @@ -305,7 +298,6 @@ namespace cds { namespace container { } return false; } -# endif /// Removes an element from first segment of the queue /** diff --git a/cds/container/skip_list_base.h b/cds/container/skip_list_base.h index c753e1ce..9d50da06 100644 --- a/cds/container/skip_list_base.h +++ b/cds/container/skip_list_base.h @@ -182,7 +182,6 @@ namespace cds { namespace container { node_type( nHeight, nHeight > 1 ? reinterpret_cast(pMem + c_nNodeSize) : nullptr, v ); } -# ifdef CDS_EMPLACE_SUPPORT template node_type * New( unsigned int nHeight, Args&&... args ) { @@ -191,7 +190,6 @@ namespace cds { namespace container { node_type( nHeight, nHeight > 1 ? reinterpret_cast(pMem + c_nNodeSize) : nullptr, std::forward(args)... ); } -# endif void Delete( node_type * p ) { diff --git a/cds/container/skip_list_map_impl.h b/cds/container/skip_list_map_impl.h index 0f9ccea6..736692cd 100644 --- a/cds/container/skip_list_map_impl.h +++ b/cds/container/skip_list_map_impl.h @@ -397,13 +397,9 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT /// For key \p key inserts data of type \ref value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( K&& key, Args&&... args ) @@ -415,8 +411,6 @@ namespace cds { namespace container { } return false; } -# endif - /// Ensures that the \p key exists in the map /** diff --git a/cds/container/skip_list_map_nogc.h b/cds/container/skip_list_map_nogc.h index 2ab08886..76644e65 100644 --- a/cds/container/skip_list_map_nogc.h +++ b/cds/container/skip_list_map_nogc.h @@ -262,22 +262,17 @@ namespace cds { namespace container { return it; } -# ifdef CDS_EMPLACE_SUPPORT /// For key \p key inserts data of type \ref mapped_type constructed with std::forward(args)... /** \p key_type should be constructible from type \p K Returns \p true if inserting successful, \p false otherwise. - - This function is available only for compiler that supports - variadic template and move semantics */ template iterator emplace( K&& key, Args&&... args ) { return base_class::emplace( std::forward(key), std::move(mapped_type(std::forward(args)...))); } -# endif /// Ensures that the key \p key exists in the map /** diff --git a/cds/container/skip_list_map_rcu.h b/cds/container/skip_list_map_rcu.h index 42b6d62f..46ce635a 100644 --- a/cds/container/skip_list_map_rcu.h +++ b/cds/container/skip_list_map_rcu.h @@ -425,15 +425,11 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT /// For key \p key inserts data of type \ref value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. RCU \p synchronize method can be called. RCU should not be locked. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( K&& key, Args&&... args ) @@ -445,8 +441,6 @@ namespace cds { namespace container { } return false; } -# endif - /// Ensures that the \p key exists in the map /** diff --git a/cds/container/skip_list_set_impl.h b/cds/container/skip_list_set_impl.h index 1a38e989..e92b5670 100644 --- a/cds/container/skip_list_set_impl.h +++ b/cds/container/skip_list_set_impl.h @@ -394,13 +394,9 @@ namespace cds { namespace container { return bRes; } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref cds_containewr_SkipListSet_value_type "value_type" constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( Args&&... args ) @@ -412,7 +408,6 @@ namespace cds { namespace container { } return false; } -# endif /// Delete \p key from the set /** \anchor cds_nonintrusive_SkipListSet_erase_val diff --git a/cds/container/skip_list_set_nogc.h b/cds/container/skip_list_set_nogc.h index 17d22fbc..b549bc15 100644 --- a/cds/container/skip_list_set_nogc.h +++ b/cds/container/skip_list_set_nogc.h @@ -51,7 +51,6 @@ namespace cds { namespace container { } } -# ifdef CDS_EMPLACE_SUPPORT template node_type( unsigned int nHeight, atomic_ptr * pTower, Q&& q, Args&&... args ) : m_Value( std::forward(q), std::forward(args)... ) @@ -61,10 +60,8 @@ namespace cds { namespace container { base_class::make_tower( nHeight, pTower ); } } -# endif - private: - node_type() ; // no default ctor + node_type() = delete; // no default ctor }; typedef skip_list::details::node_allocator< node_type, type_traits> node_allocator; @@ -274,13 +271,9 @@ namespace cds { namespace container { return end(); } -#ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref value_type constructed with std::forward(args)... /** Return an iterator pointing to inserted item if success \ref end() otherwise - - This function is available only for compiler that supports - variadic template and move semantics */ template iterator emplace( Args&&... args ) @@ -291,7 +284,6 @@ namespace cds { namespace container { } return end(); } -#endif /// Ensures that the item \p val exists in the set /** diff --git a/cds/container/skip_list_set_rcu.h b/cds/container/skip_list_set_rcu.h index fa3f22bb..2ea9f497 100644 --- a/cds/container/skip_list_set_rcu.h +++ b/cds/container/skip_list_set_rcu.h @@ -455,15 +455,11 @@ namespace cds { namespace container { return bRes; } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. RCU \p synchronize method can be called. RCU should not be locked. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( Args&&... args ) @@ -475,7 +471,6 @@ namespace cds { namespace container { } return false; } -# endif /// Delete \p key from the set /** \anchor cds_nonintrusive_SkipListSet_rcu_erase_val diff --git a/cds/container/split_list_map.h b/cds/container/split_list_map.h index d033d24c..2e8b2b67 100644 --- a/cds/container/split_list_map.h +++ b/cds/container/split_list_map.h @@ -330,23 +330,17 @@ namespace cds { namespace container { return base_class::insert( std::make_pair( key, mapped_type() ), func ); } -# ifdef CDS_EMPLACE_SUPPORT /// For key \p key inserts data of type \ref mapped_type constructed with std::forward(args)... /** \p key_type should be constructible from type \p K Returns \p true if inserting successful, \p false otherwise. - - This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( K&& key, Args&&... args ) { return base_class::emplace( std::forward(key), std::move(mapped_type(std::forward(args)...))); } -# endif - /// Ensures that the \p key exists in the map /** diff --git a/cds/container/split_list_map_nogc.h b/cds/container/split_list_map_nogc.h index af963c6a..f7cbac3b 100644 --- a/cds/container/split_list_map_nogc.h +++ b/cds/container/split_list_map_nogc.h @@ -208,22 +208,17 @@ namespace cds { namespace container { return it; } -# ifdef CDS_EMPLACE_SUPPORT /// For key \p key inserts data of type \ref mapped_type constructed with std::forward(args)... /** \p key_type should be constructible from type \p K Returns \p true if inserting successful, \p false otherwise. - - This function is available only for compiler that supports - variadic template and move semantics */ template iterator emplace( K&& key, Args&&... args ) { return base_class::emplace( std::forward(key), std::move(mapped_type(std::forward(args)...))); } -# endif /// Ensures that the key \p key exists in the map /** diff --git a/cds/container/split_list_map_rcu.h b/cds/container/split_list_map_rcu.h index b42ee5bc..b8bc6638 100644 --- a/cds/container/split_list_map_rcu.h +++ b/cds/container/split_list_map_rcu.h @@ -372,7 +372,6 @@ namespace cds { namespace container { return base_class::insert( std::make_pair( key, mapped_type() ), func ); } -# ifdef CDS_EMPLACE_SUPPORT /// For key \p key inserts data of type \ref mapped_type constructed with std::forward(args)... /** \p key_type should be constructible from type \p K @@ -380,16 +379,12 @@ namespace cds { namespace container { The function applies RCU lock internally. Returns \p true if inserting successful, \p false otherwise. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( K&& key, Args&&... args ) { return base_class::emplace( std::forward(key), std::move(mapped_type(std::forward(args)...))); } -# endif /// Ensures that the \p key exists in the map /** diff --git a/cds/container/split_list_set.h b/cds/container/split_list_set.h index ff176fd8..cfbe04bd 100644 --- a/cds/container/split_list_set.h +++ b/cds/container/split_list_set.h @@ -192,13 +192,11 @@ namespace cds { namespace container { # endif } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( Args&&... args ) { return cxx_node_allocator().MoveNew( std::forward(args)...); } -# endif static void free_node( node_type * pNode ) { @@ -483,20 +481,15 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \p %value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. - - @note This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( Args&&... args ) { return insert_node( alloc_node( std::forward(args)...)); } -# endif /// Ensures that the \p item exists in the set /** diff --git a/cds/container/split_list_set_nogc.h b/cds/container/split_list_set_nogc.h index ccee6600..11a90ed1 100644 --- a/cds/container/split_list_set_nogc.h +++ b/cds/container/split_list_set_nogc.h @@ -63,13 +63,11 @@ namespace cds { namespace container { return cxx_node_allocator().New( v ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( Args&&... args ) { return cxx_node_allocator().MoveNew( std::forward(args)...); } -# endif static void free_node( node_type * pNode ) { @@ -269,20 +267,15 @@ namespace cds { namespace container { return insert_node( alloc_node( val ) ); } -#ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \ref value_type constructed with std::forward(args)... /** Return an iterator pointing to inserted item if success \ref end() otherwise - - This function is available only for compiler that supports - variadic template and move semantics */ template iterator emplace( Args&&... args ) { return insert_node( alloc_node( std::forward(args)... ) ); } -#endif /// Ensures that the item \p val exists in the set /** diff --git a/cds/container/split_list_set_rcu.h b/cds/container/split_list_set_rcu.h index 0cd2506d..44475642 100644 --- a/cds/container/split_list_set_rcu.h +++ b/cds/container/split_list_set_rcu.h @@ -238,13 +238,11 @@ namespace cds { namespace container { } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node( Args&&... args ) { return cxx_node_allocator().MoveNew( std::forward(args)...); } -# endif static void free_node( node_type * pNode ) { @@ -537,22 +535,17 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \p value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. The function applies RCU lock internally. - - @note This function is available only for compiler that supports - variadic template and move semantics. */ template bool emplace( Args&&... args ) { return insert_node( alloc_node( std::forward(args)...)); } -# endif /// Ensures that the \p item exists in the set /** diff --git a/cds/container/striped_map.h b/cds/container/striped_map.h index ec447233..81be3321 100644 --- a/cds/container/striped_map.h +++ b/cds/container/striped_map.h @@ -694,13 +694,9 @@ namespace cds { namespace container { return base_class::insert( key, func ); } -# ifdef CDS_EMPLACE_SUPPORT /// For key \p key inserts data of type \ref mapped_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. - - This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( K&& key, Args&&... args ) @@ -722,7 +718,6 @@ namespace cds { namespace container { return bOk; } -# endif /// Ensures that the \p key exists in the map /** diff --git a/cds/container/striped_map/boost_list.h b/cds/container/striped_map/boost_list.h index 10884098..5f9a0219 100644 --- a/cds/container/striped_map/boost_list.h +++ b/cds/container/striped_map/boost_list.h @@ -149,7 +149,6 @@ namespace cds { namespace intrusive { namespace striped_set { return false; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace( K&& key, Args&&... args ) { @@ -160,7 +159,6 @@ namespace cds { namespace intrusive { namespace striped_set { } return false; } -# endif template std::pair ensure( const Q& key, Func func ) diff --git a/cds/container/striped_map/boost_slist.h b/cds/container/striped_map/boost_slist.h index e8722c23..0785ccf6 100644 --- a/cds/container/striped_map/boost_slist.h +++ b/cds/container/striped_map/boost_slist.h @@ -160,7 +160,6 @@ namespace cds { namespace intrusive { namespace striped_set { return false; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace( K&& key, Args&&... args ) { @@ -171,7 +170,6 @@ namespace cds { namespace intrusive { namespace striped_set { } return false; } -# endif template std::pair ensure( const Q& key, Func func ) diff --git a/cds/container/striped_map/std_hash_map_std.h b/cds/container/striped_map/std_hash_map_std.h index f12f6133..4aec8052 100644 --- a/cds/container/striped_map/std_hash_map_std.h +++ b/cds/container/striped_map/std_hash_map_std.h @@ -114,19 +114,12 @@ namespace cds { namespace intrusive { namespace striped_set { return res.second; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace( Q&& key, Args&&... args ) { -# if CDS_COMPILER == CDS_COMPILER_GCC && CDS_COMPILER_VERSION < 40800 || CDS_COMPILER == CDS_COMPILER_CLANG && !defined(__LIBCPP_VERSION) - // GCC < 4.8: std::map has no "emplace" member function. Emulate it - std::pair res = m_Map.insert( value_type( std::forward(key), mapped_type( std::forward(args)...))); -# else std::pair res = m_Map.emplace( std::forward(key), std::move( mapped_type(std::forward(args)...)) ); -# endif return res.second; } -# endif template std::pair ensure( const Q& key, Func func ) diff --git a/cds/container/striped_map/std_list.h b/cds/container/striped_map/std_list.h index 683c2d6f..06cf2107 100644 --- a/cds/container/striped_map/std_list.h +++ b/cds/container/striped_map/std_list.h @@ -157,7 +157,6 @@ namespace cds { namespace intrusive { namespace striped_set { return false; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace( K&& key, Args&&... args ) { @@ -173,7 +172,6 @@ namespace cds { namespace intrusive { namespace striped_set { } return false; } -# endif template std::pair ensure( const Q& key, Func func ) diff --git a/cds/container/striped_map/std_map.h b/cds/container/striped_map/std_map.h index 294ec9e4..7aeeb3f0 100644 --- a/cds/container/striped_map/std_map.h +++ b/cds/container/striped_map/std_map.h @@ -110,19 +110,12 @@ namespace cds { namespace intrusive { namespace striped_set { return res.second; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace( Q&& key, Args&&... args ) { -# if CDS_COMPILER == CDS_COMPILER_GCC && CDS_COMPILER_VERSION < 40800 || CDS_COMPILER == CDS_COMPILER_CLANG && !defined(__LIBCPP_VERSION) - // GCC < 4.8: std::map has no "emplace" member function. Emulate it - std::pair res = m_Map.insert( value_type( std::forward(key), mapped_type( std::forward(args)...))); -# else std::pair res = m_Map.emplace( std::forward(key), std::move(mapped_type( std::forward(args)...))); -# endif return res.second; } -# endif template std::pair ensure( const Q& key, Func func ) diff --git a/cds/container/striped_set.h b/cds/container/striped_set.h index 7e338dfc..13a1be43 100644 --- a/cds/container/striped_set.h +++ b/cds/container/striped_set.h @@ -635,13 +635,9 @@ namespace cds { namespace container { return bOk; } -# ifdef CDS_EMPLACE_SUPPORT /// Inserts data of type \p %value_type constructed with std::forward(args)... /** Returns \p true if inserting successful, \p false otherwise. - - This function is available only for compiler that supports - variadic template and move semantics */ template bool emplace( Args&&... args ) @@ -662,7 +658,6 @@ namespace cds { namespace container { base_class::resize(); return bOk; } -# endif /// Ensures that the \p val exists in the set /** diff --git a/cds/container/striped_set/adapter.h b/cds/container/striped_set/adapter.h index 6bd3927d..707f2b4e 100644 --- a/cds/container/striped_set/adapter.h +++ b/cds/container/striped_set/adapter.h @@ -270,14 +270,12 @@ namespace cds { namespace container { return res.second; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace( Args&&... args ) { std::pair res = m_Set.emplace( std::forward(args)... ); return res.second; } -# endif template std::pair ensure( const Q& val, Func func ) @@ -409,14 +407,12 @@ namespace cds { namespace container { return res.second; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace( Q&& key, Args&&... args ) { std::pair res = m_Map.emplace( std::forward(key), std::move( mapped_type( std::forward(args)...))); return res.second; } -# endif template std::pair ensure( const Q& val, Func func ) diff --git a/cds/container/striped_set/boost_list.h b/cds/container/striped_set/boost_list.h index c72aad07..a9f38c43 100644 --- a/cds/container/striped_set/boost_list.h +++ b/cds/container/striped_set/boost_list.h @@ -143,7 +143,6 @@ namespace cds { namespace intrusive { namespace striped_set { return false; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace( Args&&... args ) { @@ -155,7 +154,6 @@ namespace cds { namespace intrusive { namespace striped_set { } return false; } -# endif template std::pair ensure( Q const& val, Func func ) diff --git a/cds/container/striped_set/boost_slist.h b/cds/container/striped_set/boost_slist.h index 3a390e5b..c45ab4ec 100644 --- a/cds/container/striped_set/boost_slist.h +++ b/cds/container/striped_set/boost_slist.h @@ -151,7 +151,6 @@ namespace cds { namespace intrusive { namespace striped_set { return false; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace( Args&&... args ) { @@ -163,7 +162,6 @@ namespace cds { namespace intrusive { namespace striped_set { } return false; } -# endif template std::pair ensure( const Q& val, Func func ) diff --git a/cds/container/striped_set/boost_stable_vector.h b/cds/container/striped_set/boost_stable_vector.h index a668ca92..142699a6 100644 --- a/cds/container/striped_set/boost_stable_vector.h +++ b/cds/container/striped_set/boost_stable_vector.h @@ -158,7 +158,6 @@ namespace cds { namespace intrusive { namespace striped_set { return false; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace( Args&&... args ) { @@ -170,7 +169,6 @@ namespace cds { namespace intrusive { namespace striped_set { } return false; } -# endif /// Ensures that the \p item exists in the container /** diff --git a/cds/container/striped_set/boost_vector.h b/cds/container/striped_set/boost_vector.h index e4698776..3979e8fe 100644 --- a/cds/container/striped_set/boost_vector.h +++ b/cds/container/striped_set/boost_vector.h @@ -138,7 +138,6 @@ namespace cds { namespace intrusive { namespace striped_set { return false; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace( Args&&... args ) { @@ -150,7 +149,6 @@ namespace cds { namespace intrusive { namespace striped_set { } return false; } -# endif template std::pair ensure( const Q& val, Func func ) diff --git a/cds/container/striped_set/std_hash_set_std.h b/cds/container/striped_set/std_hash_set_std.h index fa4b6be0..dc1b8f73 100644 --- a/cds/container/striped_set/std_hash_set_std.h +++ b/cds/container/striped_set/std_hash_set_std.h @@ -97,19 +97,12 @@ namespace cds { namespace intrusive { namespace striped_set { return res.second; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace( Args&&... args ) { -# if CDS_COMPILER == CDS_COMPILER_GCC && CDS_COMPILER_VERSION < 40800 || CDS_COMPILER == CDS_COMPILER_CLANG && !defined(__LIBCPP_VERSION) - // GCC < 4.8: std::set has no "emplace" member function. Emulate it - std::pair res = m_Set.insert( value_type( std::forward(args)...)); -# else std::pair res = m_Set.emplace( std::forward(args)... ); -# endif return res.second; } -# endif template std::pair ensure( const Q& val, Func func ) diff --git a/cds/container/striped_set/std_list.h b/cds/container/striped_set/std_list.h index c67270b7..44532385 100644 --- a/cds/container/striped_set/std_list.h +++ b/cds/container/striped_set/std_list.h @@ -151,7 +151,6 @@ namespace cds { namespace intrusive { namespace striped_set { return false; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace( Args&&... args ) { @@ -172,7 +171,6 @@ namespace cds { namespace intrusive { namespace striped_set { } return false; } -# endif template std::pair ensure( const Q& val, Func func ) diff --git a/cds/container/striped_set/std_set.h b/cds/container/striped_set/std_set.h index 0df15cb7..913f95ec 100644 --- a/cds/container/striped_set/std_set.h +++ b/cds/container/striped_set/std_set.h @@ -94,19 +94,12 @@ namespace cds { namespace intrusive { namespace striped_set { return res.second; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace( Args&&... args ) { -# if CDS_COMPILER == CDS_COMPILER_GCC && CDS_COMPILER_VERSION < 40800 || CDS_COMPILER == CDS_COMPILER_CLANG && !defined(__LIBCPP_VERSION) - // GCC < 4.8: std::set has no "emplace" member function. Emulate it - std::pair res = m_Set.insert( value_type( std::forward(args)...)); -# else std::pair res = m_Set.emplace( std::forward(args)... ); -# endif return res.second; } -# endif template std::pair ensure( const Q& val, Func func ) diff --git a/cds/container/striped_set/std_vector.h b/cds/container/striped_set/std_vector.h index 39195693..a6d977bf 100644 --- a/cds/container/striped_set/std_vector.h +++ b/cds/container/striped_set/std_vector.h @@ -135,7 +135,6 @@ namespace cds { namespace intrusive { namespace striped_set { return false; } -# ifdef CDS_EMPLACE_SUPPORT template bool emplace( Args&&... args ) { @@ -153,7 +152,6 @@ namespace cds { namespace intrusive { namespace striped_set { } return false; } -# endif template std::pair ensure( const Q& val, Func func ) diff --git a/cds/container/treiber_stack.h b/cds/container/treiber_stack.h index 0360ad9e..15465403 100644 --- a/cds/container/treiber_stack.h +++ b/cds/container/treiber_stack.h @@ -49,15 +49,10 @@ namespace cds { namespace container { node_type( const value_type& val ) : m_value( val ) {} -# ifdef CDS_EMPLACE_SUPPORT template node_type( Args&&... args ) : m_value( std::forward(args)...) {} -# else - node_type() - {} -# endif }; typedef typename options::allocator::template rebind::other allocator_type; @@ -167,13 +162,11 @@ namespace cds { namespace container { { return cxx_allocator().New( val ); } -# ifdef CDS_EMPLACE_SUPPORT template static node_type * alloc_node_move( Args&&... args ) { return cxx_allocator().MoveNew( std::forward( args )... ); } -# endif static void free_node( node_type * p ) { @@ -223,12 +216,7 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT - /// Pushes data of type \ref value_type constructed with std::forward(args)... - /** - This function is available only for compiler that supports - variadic template and move semantics - */ + /// Pushes data of type \ref value_type created from std::forward(args)... template bool emplace( Args&&... args ) { @@ -239,7 +227,6 @@ namespace cds { namespace container { } return false; } -# endif /// Pop an item from the stack /** diff --git a/cds/container/tsigas_cycle_queue.h b/cds/container/tsigas_cycle_queue.h index 64fe4804..2fd81cb1 100644 --- a/cds/container/tsigas_cycle_queue.h +++ b/cds/container/tsigas_cycle_queue.h @@ -141,13 +141,11 @@ namespace cds { namespace container { { return cxx_allocator().New( val ); } -# ifdef CDS_EMPLACE_SUPPORT template static value_type * alloc_node_move( Args&&... args ) { return cxx_allocator().MoveNew( std::forward( args )... ); } -# endif static void free_node( value_type * p ) { node_deallocator()( p ); @@ -234,12 +232,7 @@ namespace cds { namespace container { return false; } -# ifdef CDS_EMPLACE_SUPPORT /// Enqueues data of type \ref value_type constructed with std::forward(args)... - /** - This function is available only for compiler that supports - variadic template and move semantics - */ template bool emplace( Args&&... args ) { @@ -250,7 +243,6 @@ namespace cds { namespace container { } return false; } -# endif /// Dequeues a value using copy functor /** diff --git a/cds/container/vyukov_mpmc_cycle_queue.h b/cds/container/vyukov_mpmc_cycle_queue.h index 8f5f8e57..5ca4a94b 100644 --- a/cds/container/vyukov_mpmc_cycle_queue.h +++ b/cds/container/vyukov_mpmc_cycle_queue.h @@ -221,12 +221,7 @@ namespace cds { namespace container { # endif } -# ifdef CDS_EMPLACE_SUPPORT /// Enqueues data of type \ref cds_container_VyukovMPMCCycleQueue_value_type "value_type" constructed with std::forward(args)... - /** - This function is available only for compiler that supports - variadic template and move semantics - */ template bool emplace( Args&&... args ) { @@ -257,9 +252,7 @@ namespace cds { namespace container { ++m_ItemCounter; return true; - } -# endif /// Dequeues an item from queue /** @anchor cds_container_VyukovMPMCCycleQueue_dequeue_func diff --git a/cds/details/allocator.h b/cds/details/allocator.h index c621b9f5..9936cdac 100644 --- a/cds/details/allocator.h +++ b/cds/details/allocator.h @@ -50,19 +50,12 @@ namespace cds { return Construct( allocator_type::allocate(1), src... ); } -# ifdef CDS_EMPLACE_SUPPORT /// Analogue of operator new T( std::forward(args)... ) (move semantics) - /** - This function is available only for compiler that supports - variadic template and move semantics - */ template value_type * MoveNew( Args&&... args ) { return MoveConstruct( allocator_type::allocate(1), std::forward(args)... ); } -# endif - /// Analogue of operator new T[\p nCount ] value_type * NewArray( size_t nCount ) @@ -137,18 +130,12 @@ namespace cds { return new( p ) value_type( src... ); } -# ifdef CDS_EMPLACE_SUPPORT /// Analogue of placement operator new( p ) T( std::forward(args)... ) - /** - This function is available only for compiler that supports - variadic template and move semantics - */ template value_type * MoveConstruct( void * p, Args&&... args ) { return new( p ) value_type( std::forward(args)... ); } -# endif /// Rebinds allocator to other type \p Q instead of \p T template diff --git a/cds/details/defs.h b/cds/details/defs.h index 38340ae5..e7d164b0 100644 --- a/cds/details/defs.h +++ b/cds/details/defs.h @@ -348,8 +348,6 @@ namespace cds {} # define CDS_NOEXCEPT_DEFAULTED_(expr) CDS_NOEXCEPT_( expr ) #endif -#define CDS_EMPLACE_SUPPORT - #ifdef CDS_CXX11_INLINE_NAMESPACE_SUPPORT # define CDS_CXX11_INLINE_NAMESPACE inline #else diff --git a/doxygen/cds.doxy b/doxygen/cds.doxy index 066ccd04..9efb5c8d 100644 --- a/doxygen/cds.doxy +++ b/doxygen/cds.doxy @@ -1404,7 +1404,6 @@ PREDEFINED = CDS_BUILD_BITS=32 \ CDS_ATOMIC=std \ CDS_DELETE_SPECIFIER="=delete"\ CDS_DEFAULT_SPECIFIER="=default" \ - CDS_EMPLACE_SUPPORT \ CDS_DECL_OPTIONS="typename... Options" \ CDS_DECL_OPTIONS1="typename... Options" \ CDS_DECL_OPTIONS2="typename... Options" \ diff --git a/tests/test-hdr/map/hdr_cuckoo_map.h b/tests/test-hdr/map/hdr_cuckoo_map.h index c88f1dac..ccc7cfa9 100644 --- a/tests/test-hdr/map/hdr_cuckoo_map.h +++ b/tests/test-hdr/map/hdr_cuckoo_map.h @@ -321,7 +321,6 @@ namespace map { CPPUNIT_ASSERT( m.empty() ); CPPUNIT_ASSERT( check_size( m, 0 )); -# ifdef CDS_EMPLACE_SUPPORT // emplace test CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0 CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731 @@ -346,8 +345,6 @@ namespace map { m.clear(); CPPUNIT_ASSERT( m.empty() ); CPPUNIT_ASSERT( check_size( m, 0 )); - -# endif } template diff --git a/tests/test-hdr/map/hdr_map.h b/tests/test-hdr/map/hdr_map.h index 34fd8c42..08a3fa6c 100644 --- a/tests/test-hdr/map/hdr_map.h +++ b/tests/test-hdr/map/hdr_map.h @@ -442,7 +442,6 @@ namespace map { CPPUNIT_ASSERT( m.empty() ); CPPUNIT_ASSERT( check_size( m, 0 )); -# ifdef CDS_EMPLACE_SUPPORT // emplace test CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0 CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731 @@ -467,8 +466,6 @@ namespace map { m.clear(); CPPUNIT_ASSERT( m.empty() ); CPPUNIT_ASSERT( check_size( m, 0 )); - -# endif } @@ -540,7 +537,6 @@ namespace map { CPPUNIT_ASSERT( it->second.m_val == 120 * 5 ); CPPUNIT_ASSERT( m.find_with(120, less()) == m.find(120) ); -# ifdef CDS_EMPLACE_SUPPORT // emplace test it = m.emplace( 151 ) ; // key = 151, val = 0 CPPUNIT_ASSERT( it != m.end() ); @@ -574,7 +570,6 @@ namespace map { CPPUNIT_ASSERT( it != m.end() ); CPPUNIT_ASSERT( it->first == 151 ); CPPUNIT_ASSERT( it->second.m_val == 0 ); -# endif } // iterator test diff --git a/tests/test-hdr/map/hdr_skiplist_map.h b/tests/test-hdr/map/hdr_skiplist_map.h index 52cc8f47..7c6f6a4d 100644 --- a/tests/test-hdr/map/hdr_skiplist_map.h +++ b/tests/test-hdr/map/hdr_skiplist_map.h @@ -289,7 +289,6 @@ namespace map { CPPUNIT_ASSERT( it != m.end() ); CPPUNIT_ASSERT( it->second.m_val == 120 * 5 ); -# ifdef CDS_EMPLACE_SUPPORT // emplace test it = m.emplace( 151 ) ; // key = 151, val = 0 CPPUNIT_ASSERT( it != m.end() ); @@ -323,7 +322,6 @@ namespace map { CPPUNIT_ASSERT( it != m.end() ); CPPUNIT_ASSERT( it->first == 151 ); CPPUNIT_ASSERT( it->second.m_val == 0 ); -# endif m.clear(); CPPUNIT_ASSERT( m.empty() ); diff --git a/tests/test-hdr/map/hdr_striped_map.h b/tests/test-hdr/map/hdr_striped_map.h index 41c2c8c3..352c26ef 100644 --- a/tests/test-hdr/map/hdr_striped_map.h +++ b/tests/test-hdr/map/hdr_striped_map.h @@ -271,7 +271,6 @@ namespace map { CPPUNIT_ASSERT( m.empty() ); CPPUNIT_ASSERT( check_size( m, 0 )); -# ifdef CDS_EMPLACE_SUPPORT // emplace test CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0 CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731 @@ -296,8 +295,6 @@ namespace map { m.clear(); CPPUNIT_ASSERT( m.empty() ); CPPUNIT_ASSERT( check_size( m, 0 )); - -# endif } template @@ -477,7 +474,6 @@ namespace map { CPPUNIT_ASSERT( m.empty() ); CPPUNIT_ASSERT( check_size( m, 0 )); -# ifdef CDS_EMPLACE_SUPPORT // emplace test CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0 CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731 @@ -502,8 +498,6 @@ namespace map { m.clear(); CPPUNIT_ASSERT( m.empty() ); CPPUNIT_ASSERT( check_size( m, 0 )); - -# endif } template diff --git a/tests/test-hdr/ordered_list/hdr_lazy.h b/tests/test-hdr/ordered_list/hdr_lazy.h index dfa95896..2ef4073f 100644 --- a/tests/test-hdr/ordered_list/hdr_lazy.h +++ b/tests/test-hdr/ordered_list/hdr_lazy.h @@ -363,7 +363,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); -#ifdef CDS_EMPLACE_SUPPORT { int i; // insert test @@ -385,7 +384,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); } -#endif // Iterator test { @@ -647,7 +645,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); -#ifdef CDS_EMPLACE_SUPPORT // insert test CPPUNIT_ASSERT( l.emplace( 501 ) != l.end()); CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end()); @@ -674,8 +671,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); -#endif - } void HP_cmp(); diff --git a/tests/test-hdr/ordered_list/hdr_lazy_kv.h b/tests/test-hdr/ordered_list/hdr_lazy_kv.h index 5d9fdaa0..34804647 100644 --- a/tests/test-hdr/ordered_list/hdr_lazy_kv.h +++ b/tests/test-hdr/ordered_list/hdr_lazy_kv.h @@ -193,7 +193,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); -#ifdef CDS_EMPLACE_SUPPORT // insert test CPPUNIT_ASSERT( l.emplace( 501 ) ); CPPUNIT_ASSERT( l.emplace( 251, 152 )); @@ -209,7 +208,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); -#endif // Iterator test { @@ -512,7 +510,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); -#ifdef CDS_EMPLACE_SUPPORT // insert test CPPUNIT_ASSERT( l.emplace( 501 ) != l.end()); CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end()); @@ -533,7 +530,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); -#endif // Iterator test { diff --git a/tests/test-hdr/ordered_list/hdr_michael.h b/tests/test-hdr/ordered_list/hdr_michael.h index d77b7219..a0fe03e0 100644 --- a/tests/test-hdr/ordered_list/hdr_michael.h +++ b/tests/test-hdr/ordered_list/hdr_michael.h @@ -363,7 +363,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); -#ifdef CDS_EMPLACE_SUPPORT { int i; @@ -386,7 +385,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); } -#endif // Iterator test { @@ -648,7 +646,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); -#ifdef CDS_EMPLACE_SUPPORT // insert test CPPUNIT_ASSERT( l.emplace( 501 ) != l.end() ); CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end()); @@ -675,7 +672,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); -#endif } void HP_cmp(); diff --git a/tests/test-hdr/ordered_list/hdr_michael_kv.h b/tests/test-hdr/ordered_list/hdr_michael_kv.h index 8f701c79..9d5f3e95 100644 --- a/tests/test-hdr/ordered_list/hdr_michael_kv.h +++ b/tests/test-hdr/ordered_list/hdr_michael_kv.h @@ -193,7 +193,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); -#ifdef CDS_EMPLACE_SUPPORT // insert test CPPUNIT_ASSERT( l.emplace( 501 ) ); CPPUNIT_ASSERT( l.emplace( 251, 152 )); @@ -209,7 +208,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); -#endif // Iterator test { @@ -523,7 +521,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); -#ifdef CDS_EMPLACE_SUPPORT // insert test CPPUNIT_ASSERT( l.emplace( 501 ) != l.end()); CPPUNIT_ASSERT( l.emplace( 251, 152 ) != l.end()); @@ -544,7 +541,6 @@ namespace ordlist { l.clear(); CPPUNIT_ASSERT( l.empty() ); -#endif // Iterator test { diff --git a/tests/test-hdr/priority_queue/hdr_pqueue.h b/tests/test-hdr/priority_queue/hdr_pqueue.h index 33c17cd1..cb8025b4 100644 --- a/tests/test-hdr/priority_queue/hdr_pqueue.h +++ b/tests/test-hdr/priority_queue/hdr_pqueue.h @@ -140,7 +140,6 @@ namespace priority_queue { // Push test for ( value_type * p = pFirst; p < pLast; ++p ) { -#ifdef CDS_EMPLACE_SUPPORT switch ( pq.size() & 3 ) { case 1: CPPUNIT_ASSERT( pq.emplace( p->k, p->v )); @@ -151,9 +150,6 @@ namespace priority_queue { default: CPPUNIT_ASSERT( pq.push( *p )); } -#else - CPPUNIT_ASSERT( pq.push( *p )); -#endif CPPUNIT_ASSERT( !pq.empty() ); CPPUNIT_ASSERT( pq.size() == ++nSize ); } diff --git a/tests/test-hdr/queue/hdr_segmented_queue.h b/tests/test-hdr/queue/hdr_segmented_queue.h index acb415c0..d1e42919 100644 --- a/tests/test-hdr/queue/hdr_segmented_queue.h +++ b/tests/test-hdr/queue/hdr_segmented_queue.h @@ -146,7 +146,6 @@ namespace queue { } //emplace -# ifdef CDS_EMPLACE_SUPPORT { size_t nMajor = 0; size_t nMinor = 0; @@ -183,7 +182,6 @@ namespace queue { CPPUNIT_CHECK( q.empty() ); CPPUNIT_CHECK( misc::check_size( q, 0 )); } -# endif // pop from empty queue { diff --git a/tests/test-hdr/queue/queue_test_header.h b/tests/test-hdr/queue/queue_test_header.h index be392663..bd374fd4 100644 --- a/tests/test-hdr/queue/queue_test_header.h +++ b/tests/test-hdr/queue/queue_test_header.h @@ -61,7 +61,6 @@ namespace queue { template void test_emplace( Queue& q ) { -# ifdef CDS_EMPLACE_SUPPORT int it; for ( size_t i = 0; i < 3; ++i ) { CPPUNIT_ASSERT( q.emplace( static_cast( i * 42 )) ); @@ -71,7 +70,6 @@ namespace queue { CPPUNIT_ASSERT( it == static_cast( i * 42 )); CPPUNIT_ASSERT( q.empty() ); } -# endif } template @@ -128,7 +126,6 @@ namespace queue { template void test_emplace_ic( Queue& q ) { -# ifdef CDS_EMPLACE_SUPPORT int it = 0; for ( size_t i = 0; i < 3; ++i ) { CPPUNIT_ASSERT( q.emplace( (int) i * 10 ) ); @@ -139,7 +136,6 @@ namespace queue { CPPUNIT_ASSERT( q.empty() ); CPPUNIT_ASSERT( q.size() == 0 ); } -# endif } public: diff --git a/tests/test-hdr/set/hdr_cuckoo_set.h b/tests/test-hdr/set/hdr_cuckoo_set.h index bc8989c8..442dd7de 100644 --- a/tests/test-hdr/set/hdr_cuckoo_set.h +++ b/tests/test-hdr/set/hdr_cuckoo_set.h @@ -456,7 +456,6 @@ namespace set { CPPUNIT_ASSERT( s.empty() ); CPPUNIT_ASSERT( check_size( s, 0 )); -# ifdef CDS_EMPLACE_SUPPORT // emplace test CPPUNIT_ASSERT( s.emplace( 151 )) ; // key = 151, val = 151 CPPUNIT_ASSERT( s.emplace( 174, 471 )) ; // key = 174, val = 471 @@ -489,7 +488,6 @@ namespace set { s.clear(); CPPUNIT_ASSERT( s.empty() ); CPPUNIT_ASSERT( check_size( s, 0 )); -# endif } template diff --git a/tests/test-hdr/set/hdr_set.h b/tests/test-hdr/set/hdr_set.h index 5fd92b31..c8e1e06f 100644 --- a/tests/test-hdr/set/hdr_set.h +++ b/tests/test-hdr/set/hdr_set.h @@ -615,7 +615,6 @@ namespace set { CPPUNIT_ASSERT( s.empty() ); CPPUNIT_ASSERT( check_size( s, 0 )); -# ifdef CDS_EMPLACE_SUPPORT // emplace test CPPUNIT_ASSERT( s.emplace( 151 )) ; // key = 151, val = 151 CPPUNIT_ASSERT( s.emplace( 174, 471 )) ; // key = 174, val = 471 @@ -648,7 +647,6 @@ namespace set { s.clear(); CPPUNIT_ASSERT( s.empty() ); CPPUNIT_ASSERT( check_size( s, 0 )); -# endif } @@ -734,7 +732,6 @@ namespace set { CPPUNIT_ASSERT( it->key() == 50 ); CPPUNIT_ASSERT( it->val() == 25 ); -# ifdef CDS_EMPLACE_SUPPORT // emplace test it = s.emplace( 151 ) ; // key = 151, val = 151 CPPUNIT_ASSERT( it != s.end() ); @@ -765,7 +762,6 @@ namespace set { CPPUNIT_ASSERT( it != s.end() ); CPPUNIT_ASSERT( it->key() == 151 ); CPPUNIT_ASSERT( it->val() == 151 ); -# endif //s.clear(); //CPPUNIT_ASSERT( s.empty() ); diff --git a/tests/test-hdr/set/hdr_skiplist_set.h b/tests/test-hdr/set/hdr_skiplist_set.h index 706e3c8d..c593a0cf 100644 --- a/tests/test-hdr/set/hdr_skiplist_set.h +++ b/tests/test-hdr/set/hdr_skiplist_set.h @@ -329,7 +329,6 @@ namespace set { CPPUNIT_ASSERT( it->key() == 50 ); CPPUNIT_ASSERT( it->val() == 25 ); -# ifdef CDS_EMPLACE_SUPPORT // emplace test it = s.emplace( 151 ) ; // key = 151, val = 151 CPPUNIT_ASSERT( it != s.end() ); @@ -360,7 +359,6 @@ namespace set { CPPUNIT_ASSERT( it != s.end() ); CPPUNIT_ASSERT( it->key() == 151 ); CPPUNIT_ASSERT( it->val() == 151 ); -# endif CPPUNIT_ASSERT( !s.empty() ); s.clear(); diff --git a/tests/test-hdr/set/hdr_striped_set.h b/tests/test-hdr/set/hdr_striped_set.h index b76f18c8..1535615a 100644 --- a/tests/test-hdr/set/hdr_striped_set.h +++ b/tests/test-hdr/set/hdr_striped_set.h @@ -471,7 +471,6 @@ namespace set { CPPUNIT_ASSERT( s.empty() ); CPPUNIT_ASSERT( check_size( s, 0 )); -# ifdef CDS_EMPLACE_SUPPORT // emplace test CPPUNIT_ASSERT( s.emplace( 151 )) ; // key = 151, val = 151 CPPUNIT_ASSERT( s.emplace( 174, 471 )) ; // key = 174, val = 471 @@ -504,7 +503,6 @@ namespace set { s.clear(); CPPUNIT_ASSERT( s.empty() ); CPPUNIT_ASSERT( check_size( s, 0 )); -# endif } template @@ -665,7 +663,6 @@ namespace set { CPPUNIT_ASSERT( s.empty() ); CPPUNIT_ASSERT( check_size( s, 0 )); -# ifdef CDS_EMPLACE_SUPPORT // emplace test CPPUNIT_ASSERT( s.emplace( 151 )) ; // key = 151, val = 151 CPPUNIT_ASSERT( s.emplace( 174, 471 )) ; // key = 174, val = 471 @@ -698,7 +695,6 @@ namespace set { s.clear(); CPPUNIT_ASSERT( s.empty() ); CPPUNIT_ASSERT( check_size( s, 0 )); -# endif } void Striped_list(); diff --git a/tests/test-hdr/stack/hdr_treiber_stack.h b/tests/test-hdr/stack/hdr_treiber_stack.h index 789c9e84..51ad47e9 100644 --- a/tests/test-hdr/stack/hdr_treiber_stack.h +++ b/tests/test-hdr/stack/hdr_treiber_stack.h @@ -54,11 +54,9 @@ namespace stack { CPPUNIT_ASSERT( stack.push(30)); CPPUNIT_ASSERT( !stack.empty()); -#ifdef CDS_EMPLACE_SUPPORT CPPUNIT_ASSERT( stack.emplace(100)); CPPUNIT_ASSERT( stack.pop(v)); CPPUNIT_ASSERT( v == 100 ); -#endif stack.clear(); CPPUNIT_ASSERT( stack.empty() ); diff --git a/tests/test-hdr/tree/hdr_ellenbintree_map.h b/tests/test-hdr/tree/hdr_ellenbintree_map.h index 4105170f..0a20d07b 100644 --- a/tests/test-hdr/tree/hdr_ellenbintree_map.h +++ b/tests/test-hdr/tree/hdr_ellenbintree_map.h @@ -326,7 +326,6 @@ namespace tree { CPPUNIT_ASSERT( m.empty() ); CPPUNIT_ASSERT( check_size( m, 0 )); -# ifdef CDS_EMPLACE_SUPPORT // emplace test CPPUNIT_ASSERT( m.emplace(126) ) ; // key = 126, val = 0 CPPUNIT_ASSERT( m.emplace(137, 731)) ; // key = 137, val = 731 @@ -351,7 +350,6 @@ namespace tree { m.clear(); CPPUNIT_ASSERT( m.empty() ); CPPUNIT_ASSERT( check_size( m, 0 )); -# endif } template diff --git a/tests/test-hdr/tree/hdr_ellenbintree_set.h b/tests/test-hdr/tree/hdr_ellenbintree_set.h index b8726e9d..06e916d4 100644 --- a/tests/test-hdr/tree/hdr_ellenbintree_set.h +++ b/tests/test-hdr/tree/hdr_ellenbintree_set.h @@ -426,7 +426,6 @@ namespace tree { CPPUNIT_ASSERT( s.empty() ); CPPUNIT_ASSERT( check_size( s, 0 )); -# ifdef CDS_EMPLACE_SUPPORT // emplace test CPPUNIT_ASSERT( s.emplace( 151 )) ; // key = 151, val = 1510 CPPUNIT_ASSERT( s.emplace( 174, 471 )) ; // key = 174, val = 471 @@ -460,7 +459,6 @@ namespace tree { s.clear(); CPPUNIT_ASSERT( s.empty() ); CPPUNIT_ASSERT( check_size( s, 0 )); -# endif } template