Renaming map member function insert_key() to insert_with()
authorkhizmax <libcds.dev@gmail.com>
Sat, 29 Nov 2014 11:53:38 +0000 (14:53 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sat, 29 Nov 2014 11:53:38 +0000 (14:53 +0300)
28 files changed:
cds/container/cuckoo_map.h
cds/container/ellen_bintree_map_rcu.h
cds/container/impl/ellen_bintree_map.h
cds/container/impl/lazy_kvlist.h
cds/container/impl/michael_kvlist.h
cds/container/impl/skip_list_map.h
cds/container/lazy_kvlist_nogc.h
cds/container/lazy_kvlist_rcu.h
cds/container/michael_kvlist_nogc.h
cds/container/michael_kvlist_rcu.h
cds/container/michael_map.h
cds/container/michael_map_nogc.h
cds/container/michael_map_rcu.h
cds/container/skip_list_map_nogc.h
cds/container/skip_list_map_rcu.h
cds/container/split_list_map.h
cds/container/split_list_map_nogc.h
cds/container/split_list_map_rcu.h
cds/container/striped_map.h
tests/test-hdr/map/hdr_cuckoo_map.h
tests/test-hdr/map/hdr_map.h
tests/test-hdr/map/hdr_skiplist_map.h
tests/test-hdr/map/hdr_striped_map.h
tests/test-hdr/ordered_list/hdr_lazy_kv.h
tests/test-hdr/ordered_list/hdr_michael_kv.h
tests/test-hdr/tree/hdr_ellenbintree_map.h
tests/unit/map2/map_insdel_func.cpp
tests/unit/map2/map_types.h

index 1188555..826b1bb 100644 (file)
@@ -411,7 +411,7 @@ namespace cds { namespace container {
         template <typename K>
         bool insert( K const& key )
         {
-            return insert_key( key, [](value_type&){} );
+            return insert_with( key, [](value_type&){} );
         }
 
         /// Inserts new node
@@ -428,7 +428,7 @@ namespace cds { namespace container {
         template <typename K, typename V>
         bool insert( K const& key, V const& val )
         {
-            return insert_key( key, [&val](value_type& item) { item.second = val ; } );
+            return insert_with( key, [&val](value_type& item) { item.second = val ; } );
         }
 
         /// Inserts new node and initialize it by a functor
@@ -457,7 +457,7 @@ namespace cds { namespace container {
             it is preferable that the initialization should be completed only if inserting is successful.
         */
         template <typename K, typename Func>
-        bool insert_key( const K& key, Func func )
+        bool insert_with( const K& key, Func func )
         {
             scoped_node_ptr pNode( alloc_node( key ));
             if ( base_class::insert( *pNode, [&func]( node_type& item ) { func( item.m_val ); } )) {
index 6ad87c1..1e8c1ae 100644 (file)
@@ -139,7 +139,7 @@ namespace cds { namespace container {
         template <typename K>
         bool insert( K const& key )
         {
-            return insert_key( key, [](value_type&){} );
+            return insert_with( key, [](value_type&){} );
         }
 
         /// Inserts new node
@@ -195,7 +195,7 @@ namespace cds { namespace container {
             RCU \p synchronize() method can be called. RCU should not be locked.
         */
         template <typename K, typename Func>
-        bool insert_key( const K& key, Func func )
+        bool insert_with( const K& key, Func func )
         {
             scoped_node_ptr pNode( cxx_leaf_node_allocator().New( key ));
             if ( base_class::insert( *pNode, [&func]( leaf_node& item ) { func( item.m_Value ); } )) {
index 16b32a3..1d78da4 100644 (file)
@@ -137,7 +137,7 @@ namespace cds { namespace container {
         template <typename K>
         bool insert( K const& key )
         {
-            return insert_key( key, [](value_type&){} );
+            return insert_with( key, [](value_type&){} );
         }
 
         /// Inserts new node
@@ -189,7 +189,7 @@ namespace cds { namespace container {
             it is preferable that the initialization should be completed only if inserting is successful.
         */
         template <typename K, typename Func>
-        bool insert_key( const K& key, Func func )
+        bool insert_with( const K& key, Func func )
         {
             scoped_node_ptr pNode( cxx_leaf_node_allocator().New( key ));
             if ( base_class::insert( *pNode, [&func]( leaf_node& item ) { func( item.m_Value ); } )) {
index e8b83f7..579b475 100644 (file)
@@ -406,9 +406,9 @@ namespace cds { namespace container {
             it is preferable that the initialization should be completed only if inserting is successful.
         */
         template <typename K, typename Func>
-        bool insert_key( const K& key, Func func )
+        bool insert_with( const K& key, Func func )
         {
-            return insert_key_at( head(), key, func );
+            return insert_with_at( head(), key, func );
         }
 
         /// Inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
@@ -730,7 +730,7 @@ namespace cds { namespace container {
         }
 
         template <typename K, typename Func>
-        bool insert_key_at( head_type& refHead, const K& key, Func f )
+        bool insert_with_at( head_type& refHead, const K& key, Func f )
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
index a31103e..6218f69 100644 (file)
@@ -399,9 +399,9 @@ namespace cds { namespace container {
             @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
         */
         template <typename K, typename Func>
-        bool insert_key( const K& key, Func func )
+        bool insert_with( const K& key, Func func )
         {
-            return insert_key_at( head(), key, func );
+            return insert_with_at( head(), key, func );
         }
 
         /// Ensures that the \p key exists in the list
@@ -740,7 +740,7 @@ namespace cds { namespace container {
         }
 
         template <typename K, typename Func>
-        bool insert_key_at( head_type& refHead, const K& key, Func f )
+        bool insert_with_at( head_type& refHead, const K& key, Func f )
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
index 0d31172..9d0bb2a 100644 (file)
@@ -220,7 +220,7 @@ namespace cds { namespace container {
         template <typename K>
         bool insert( K const& key )
         {
-            return insert_key( key, [](value_type&){} );
+            return insert_with( key, [](value_type&){} );
         }
 
         /// Inserts new node
@@ -237,7 +237,7 @@ namespace cds { namespace container {
         template <typename K, typename V>
         bool insert( K const& key, V const& val )
         {
-            return insert_key( key, [&val](value_type& item) { item.second = val ; } );
+            return insert_with( key, [&val](value_type& item) { item.second = val ; } );
         }
 
         /// Inserts new node and initialize it by a functor
@@ -266,7 +266,7 @@ namespace cds { namespace container {
             it is preferable that the initialization should be completed only if inserting is successful.
         */
         template <typename K, typename Func>
-        bool insert_key( const K& key, Func func )
+        bool insert_with( const K& key, Func func )
         {
             scoped_node_ptr pNode( node_allocator().New( random_level(), key ));
             if ( base_class::insert( *pNode, [&func]( node_type& item ) { func( item.m_Value ); } )) {
index b5a9df8..66a4657 100644 (file)
@@ -368,9 +368,9 @@ namespace cds { namespace container {
             Returns an iterator pointed to inserted value, or \p end() if inserting is failed
         */
         template <typename K, typename Func>
-        iterator insert_key( const K& key, Func func )
+        iterator insert_with( const K& key, Func func )
         {
-            return node_to_iterator( insert_key_at( head(), key, func ));
+            return node_to_iterator( insert_with_at( head(), key, func ));
         }
 
         /// Ensures that the key \p key exists in the list
@@ -478,7 +478,7 @@ namespace cds { namespace container {
         }
 
         template <typename K, typename Func>
-        node_type * insert_key_at( head_type& refHead, const K& key, Func f )
+        node_type * insert_with_at( head_type& refHead, const K& key, Func f )
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
index 40f234f..6c7fd54 100644 (file)
@@ -392,9 +392,9 @@ namespace cds { namespace container {
             @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
         */
         template <typename K, typename Func>
-        bool insert_key( const K& key, Func func )
+        bool insert_with( const K& key, Func func )
         {
-            return insert_key_at( head(), key, func );
+            return insert_with_at( head(), key, func );
         }
 
         /// Inserts data of type \p mapped_type constructed from \p args
@@ -740,7 +740,7 @@ namespace cds { namespace container {
         }
 
         template <typename K, typename Func>
-        bool insert_key_at( head_type& refHead, const K& key, Func f )
+        bool insert_with_at( head_type& refHead, const K& key, Func f )
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
index 15a14df..3634a70 100644 (file)
@@ -386,9 +386,9 @@ namespace cds { namespace container {
             Returns an iterator pointed to inserted value, or \p end() if inserting is failed
         */
         template <typename K, typename Func>
-        iterator insert_key( const K& key, Func func )
+        iterator insert_with( const K& key, Func func )
         {
-            return node_to_iterator( insert_key_at( head(), key, func ));
+            return node_to_iterator( insert_with_at( head(), key, func ));
         }
 
         /// Ensures that the key \p key exists in the list
@@ -493,7 +493,7 @@ namespace cds { namespace container {
         }
 
         template <typename K, typename Func>
-        node_type * insert_key_at( head_type& refHead, const K& key, Func f )
+        node_type * insert_with_at( head_type& refHead, const K& key, Func f )
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
index 7545e48..4733f99 100644 (file)
@@ -385,9 +385,9 @@ namespace cds { namespace container {
             @warning See \ref cds_intrusive_item_creating "insert item troubleshooting"
         */
         template <typename K, typename Func>
-        bool insert_key( const K& key, Func func )
+        bool insert_with( const K& key, Func func )
         {
-            return insert_key_at( head(), key, func );
+            return insert_with_at( head(), key, func );
         }
 
         /// Ensures that the \p key exists in the list
@@ -739,7 +739,7 @@ namespace cds { namespace container {
         }
 
         template <typename K, typename Func>
-        bool insert_key_at( head_type& refHead, const K& key, Func f )
+        bool insert_with_at( head_type& refHead, const K& key, Func f )
         {
             scoped_node_ptr pNode( alloc_node( key ));
 
index a090a6d..ba411b7 100644 (file)
@@ -462,9 +462,9 @@ namespace cds { namespace container {
             synchronization.
         */
         template <typename K, typename Func>
-        bool insert_key( const K& key, Func func )
+        bool insert_with( const K& key, Func func )
         {
-            const bool bRet = bucket( key ).insert_key( key, func );
+            const bool bRet = bucket( key ).insert_with( key, func );
             if ( bRet )
                 ++m_ItemCounter;
             return bRet;
index cfa193e..e541b17 100644 (file)
@@ -351,10 +351,10 @@ namespace cds { namespace container {
             synchronization.
         */
         template <typename K, typename Func>
-        iterator insert_key( const K& key, Func func )
+        iterator insert_with( const K& key, Func func )
         {
             bucket_type& refBucket = bucket( key );
-            bucket_iterator it = refBucket.insert_key( key, func );
+            bucket_iterator it = refBucket.insert_with( key, func );
 
             if ( it != refBucket.end() ) {
                 ++m_ItemCounter;
index 8888759..5dc469b 100644 (file)
@@ -382,9 +382,9 @@ namespace cds { namespace container {
             synchronization.
         */
         template <typename K, typename Func>
-        bool insert_key( const K& key, Func func )
+        bool insert_with( const K& key, Func func )
         {
-            const bool bRet = bucket( key ).insert_key( key, func );
+            const bool bRet = bucket( key ).insert_with( key, func );
             if ( bRet )
                 ++m_ItemCounter;
             return bRet;
index 916de56..7745b7e 100644 (file)
@@ -211,7 +211,7 @@ namespace cds { namespace container {
             Returns an iterator pointed to inserted value, or \p end() if inserting is failed
         */
         template <typename K, typename Func>
-        iterator insert_key( K const& key, Func func )
+        iterator insert_with( K const& key, Func func )
         {
             iterator it = insert( key );
             if ( it != end() )
index 7419280..e47917c 100644 (file)
@@ -221,7 +221,7 @@ namespace cds { namespace container {
         template <typename K>
         bool insert( K const& key )
         {
-            return insert_key( key, [](value_type&){} );
+            return insert_with( key, [](value_type&){} );
         }
 
         /// Inserts new node
@@ -275,7 +275,7 @@ namespace cds { namespace container {
             RCU \p synchronize method can be called. RCU should not be locked.
         */
         template <typename K, typename Func>
-        bool insert_key( const K& key, Func func )
+        bool insert_with( const K& key, Func func )
         {
             scoped_node_ptr pNode( node_allocator().New( random_level(), key ));
             if ( base_class::insert( *pNode, [&func]( node_type& item ) { func( item.m_Value ); } )) {
index de219d1..8604056 100644 (file)
@@ -290,7 +290,7 @@ namespace cds { namespace container {
             synchronization.
         */
         template <typename K, typename Func>
-        bool insert_key( K const& key, Func func )
+        bool insert_with( K const& key, Func func )
         {
             //TODO: pass arguments by reference (make_pair makes copy)
             return base_class::insert( std::make_pair( key, mapped_type() ), func );
index ba7efc5..0922ef3 100644 (file)
@@ -203,7 +203,7 @@ namespace cds { namespace container {
             Returns an iterator pointed to inserted value, or \p end() if inserting is failed
         */
         template <typename K, typename Func>
-        iterator insert_key( const K& key, Func func )
+        iterator insert_with( const K& key, Func func )
         {
             iterator it = insert( key );
             if ( it != end() )
index 3354a1f..d0aac44 100644 (file)
@@ -326,7 +326,7 @@ namespace cds { namespace container {
             The function applies RCU lock internally.
         */
         template <typename K, typename Func>
-        bool insert_key( K const& key, Func func )
+        bool insert_with( K const& key, Func func )
         {
             //TODO: pass arguments by reference (make_pair makes copy)
             return base_class::insert( std::make_pair( key, mapped_type() ), func );
index ce9a232..8969d5b 100644 (file)
@@ -560,7 +560,7 @@ template <class Container, typename... Options>
         template <typename K>
         bool insert( K const& key )
         {
-            return insert_key( key, [](value_type&){} );
+            return insert_with( key, [](value_type&){} );
         }
 
         /// Inserts new node
@@ -577,7 +577,7 @@ template <class Container, typename... Options>
         template <typename K, typename V>
         bool insert( K const& key, V const& val )
         {
-            return insert_key( key, [&val](value_type& item) { item.second = val ; } );
+            return insert_with( key, [&val](value_type& item) { item.second = val ; } );
         }
 
         /// Inserts new node and initialize it by a functor
@@ -606,7 +606,7 @@ template <class Container, typename... Options>
             it is preferable that the initialization should be completed only if inserting is successful.
         */
         template <typename K, typename Func>
-        bool insert_key( const K& key, Func func )
+        bool insert_with( const K& key, Func func )
         {
             return base_class::insert( key, func );
         }
index 40310cf..92065c0 100644 (file)
@@ -241,14 +241,14 @@ namespace map {
             CPPUNIT_ASSERT( check_size( m, 2 ));
 
             CPPUNIT_ASSERT( !m.find(30) );
-            CPPUNIT_ASSERT( m.insert_key( 30, insert_functor<Map>() ) )    ; // value = 90
+            CPPUNIT_ASSERT( m.insert_with( 30, insert_functor<Map>() ) )    ; // value = 90
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
             CPPUNIT_ASSERT( m.find(30) );
 
-            CPPUNIT_ASSERT( !m.insert_key( 10, insert_functor<Map>() ) );
-            CPPUNIT_ASSERT( !m.insert_key( 25, insert_functor<Map>() ) );
-            CPPUNIT_ASSERT( !m.insert_key( 30, insert_functor<Map>() ) );
+            CPPUNIT_ASSERT( !m.insert_with( 10, insert_functor<Map>() ) );
+            CPPUNIT_ASSERT( !m.insert_with( 25, insert_functor<Map>() ) );
+            CPPUNIT_ASSERT( !m.insert_with( 30, insert_functor<Map>() ) );
 
             // ensure (new key)
             CPPUNIT_ASSERT( !m.find(27) );
index 1441b46..ec6ed42 100644 (file)
@@ -375,14 +375,14 @@ namespace map {
             CPPUNIT_ASSERT( check_size( m, 2 ));
 
             CPPUNIT_ASSERT( !m.find(30) );
-            CPPUNIT_ASSERT( m.insert_key( 30, insert_functor<Map>() ) )    ; // value = 90
+            CPPUNIT_ASSERT( m.insert_with( 30, insert_functor<Map>() ) )    ; // value = 90
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
             CPPUNIT_ASSERT( m.find(30) );
 
-            CPPUNIT_ASSERT( !m.insert_key( 10, insert_functor<Map>() ) );
-            CPPUNIT_ASSERT( !m.insert_key( 25, insert_functor<Map>() ) );
-            CPPUNIT_ASSERT( !m.insert_key( 30, insert_functor<Map>() ) );
+            CPPUNIT_ASSERT( !m.insert_with( 10, insert_functor<Map>() ) );
+            CPPUNIT_ASSERT( !m.insert_with( 25, insert_functor<Map>() ) );
+            CPPUNIT_ASSERT( !m.insert_with( 30, insert_functor<Map>() ) );
 
             // ensure (new key)
             CPPUNIT_ASSERT( !m.find(27) );
@@ -514,7 +514,7 @@ namespace map {
                 CPPUNIT_ASSERT( it->second.m_val == 200 );
 
                 CPPUNIT_ASSERT( m.find(55) == m.end() );
-                it = m.insert_key( 55, insert_functor<Map>() );
+                it = m.insert_with( 55, insert_functor<Map>() );
                 CPPUNIT_ASSERT( it != m.end() );
                 CPPUNIT_ASSERT( !m.empty() );
                 CPPUNIT_ASSERT( check_size( m, 3 ));
@@ -524,7 +524,7 @@ namespace map {
 
                 CPPUNIT_ASSERT( m.insert( 55 ) == m.end() );
                 CPPUNIT_ASSERT( m.insert( 55, 10 ) == m.end() );
-                CPPUNIT_ASSERT( m.insert_key( 55, insert_functor<Map>()) == m.end() );
+                CPPUNIT_ASSERT( m.insert_with( 55, insert_functor<Map>()) == m.end() );
 
                 CPPUNIT_ASSERT( m.find(10) != m.end() );
                 std::pair<iterator, bool> ensureResult = m.ensure( 10 );
index 7d5db32..e21aaaa 100644 (file)
@@ -263,7 +263,7 @@ namespace map {
             CPPUNIT_ASSERT( it->second.m_val == 200 );
 
             CPPUNIT_ASSERT( m.find(55) == m.end() );
-            it = m.insert_key( 55, insert_functor<Map>() );
+            it = m.insert_with( 55, insert_functor<Map>() );
             CPPUNIT_ASSERT( it != m.end() );
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
@@ -273,7 +273,7 @@ namespace map {
 
             CPPUNIT_ASSERT( m.insert( 55 ) == m.end() );
             CPPUNIT_ASSERT( m.insert( 55, 10 ) == m.end() );
-            CPPUNIT_ASSERT( m.insert_key( 55, insert_functor<Map>()) == m.end() );
+            CPPUNIT_ASSERT( m.insert_with( 55, insert_functor<Map>()) == m.end() );
 
             CPPUNIT_ASSERT( m.find(10) != m.end() );
             std::pair<iterator, bool> ensureResult = m.ensure( 10 );
index 5474902..06b3c87 100644 (file)
@@ -189,14 +189,14 @@ namespace map {
             CPPUNIT_ASSERT( check_size( m, 2 ));
 
             CPPUNIT_ASSERT( !m.find(30) );
-            CPPUNIT_ASSERT( m.insert_key( 30, insert_functor<Map>() ) )    ; // value = 90
+            CPPUNIT_ASSERT( m.insert_with( 30, insert_functor<Map>() ) )    ; // value = 90
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
             CPPUNIT_ASSERT( m.find(30) );
 
-            CPPUNIT_ASSERT( !m.insert_key( 10, insert_functor<Map>() ) );
-            CPPUNIT_ASSERT( !m.insert_key( 25, insert_functor<Map>() ) );
-            CPPUNIT_ASSERT( !m.insert_key( 30, insert_functor<Map>() ) );
+            CPPUNIT_ASSERT( !m.insert_with( 10, insert_functor<Map>() ) );
+            CPPUNIT_ASSERT( !m.insert_with( 25, insert_functor<Map>() ) );
+            CPPUNIT_ASSERT( !m.insert_with( 30, insert_functor<Map>() ) );
 
             // ensure (new key)
             CPPUNIT_ASSERT( !m.find(27) );
@@ -394,14 +394,14 @@ namespace map {
             CPPUNIT_ASSERT( check_size( m, 2 ));
 
             CPPUNIT_ASSERT( !m.find(30) );
-            CPPUNIT_ASSERT( m.insert_key( 30, insert_functor<Map>() ) )    ; // value = 90
+            CPPUNIT_ASSERT( m.insert_with( 30, insert_functor<Map>() ) )    ; // value = 90
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
             CPPUNIT_ASSERT( m.find(30) );
 
-            CPPUNIT_ASSERT( !m.insert_key( 10, insert_functor<Map>() ) );
-            CPPUNIT_ASSERT( !m.insert_key( 25, insert_functor<Map>() ) );
-            CPPUNIT_ASSERT( !m.insert_key( 30, insert_functor<Map>() ) );
+            CPPUNIT_ASSERT( !m.insert_with( 10, insert_functor<Map>() ) );
+            CPPUNIT_ASSERT( !m.insert_with( 25, insert_functor<Map>() ) );
+            CPPUNIT_ASSERT( !m.insert_with( 30, insert_functor<Map>() ) );
 
             // ensure (new key)
             CPPUNIT_ASSERT( !m.find(27) );
index 3a8509a..e62dcf3 100644 (file)
@@ -132,7 +132,7 @@ namespace ordlist {
             CPPUNIT_ASSERT( !l.empty() );
 
             CPPUNIT_ASSERT( !l.find( 150 ));
-            CPPUNIT_ASSERT( l.insert_key( 150, insert_functor() ));
+            CPPUNIT_ASSERT( l.insert_with( 150, insert_functor() ));
             CPPUNIT_ASSERT( l.find( 150 ));
             chk.m_nExpected = 1500;
             CPPUNIT_ASSERT( l.find_with( 150, lt<key_type>(), std::ref( chk ) ) );
@@ -175,7 +175,7 @@ namespace ordlist {
 
             // erase test
             CPPUNIT_ASSERT( !l.empty() );
-            CPPUNIT_ASSERT( l.insert_key( 200, insert_functor() ));
+            CPPUNIT_ASSERT( l.insert_with( 200, insert_functor() ));
             CPPUNIT_ASSERT( l.insert( 25 ));
             CPPUNIT_ASSERT( l.erase( 100 ));
             CPPUNIT_ASSERT( l.erase( 150 ));
@@ -492,7 +492,7 @@ namespace ordlist {
                 CPPUNIT_ASSERT( !l.empty() );
 
                 CPPUNIT_ASSERT( l.find( 150 ) == l.end() );
-                CPPUNIT_ASSERT( l.insert_key( 150, insert_functor() ) != l.end() );
+                CPPUNIT_ASSERT( l.insert_with( 150, insert_functor() ) != l.end() );
                 it = l.find( 150 );
                 CPPUNIT_ASSERT( it != l.end() );
                 CPPUNIT_ASSERT( it.key() == 150 );
index e4acdf8..d51a08f 100644 (file)
@@ -132,7 +132,7 @@ namespace ordlist {
             CPPUNIT_ASSERT( !l.empty() );
 
             CPPUNIT_ASSERT( !l.find( 150 ));
-            CPPUNIT_ASSERT( l.insert_key( 150, insert_functor() ));
+            CPPUNIT_ASSERT( l.insert_with( 150, insert_functor() ));
             CPPUNIT_ASSERT( l.find( 150 ));
             chk.m_nExpected = 1500;
             CPPUNIT_ASSERT( l.find( 150, std::ref( chk ) ) );
@@ -175,7 +175,7 @@ namespace ordlist {
 
             // erase test
             CPPUNIT_ASSERT( !l.empty() );
-            CPPUNIT_ASSERT( l.insert_key( 200, insert_functor() ));
+            CPPUNIT_ASSERT( l.insert_with( 200, insert_functor() ));
             CPPUNIT_ASSERT( l.insert( 25 ));
             CPPUNIT_ASSERT( l.erase( 100 ));
             CPPUNIT_ASSERT( l.erase( 150 ));
@@ -505,7 +505,7 @@ namespace ordlist {
                 CPPUNIT_ASSERT( !l.empty() );
 
                 CPPUNIT_ASSERT( l.find( 150 ) == l.end() );
-                CPPUNIT_ASSERT( l.insert_key( 150, insert_functor() ) != l.end() );
+                CPPUNIT_ASSERT( l.insert_with( 150, insert_functor() ) != l.end() );
                 it = l.find( 150 );
                 CPPUNIT_ASSERT( it != l.end() );
                 CPPUNIT_ASSERT( it.key() == 150 );
index d4849aa..d2c9051 100644 (file)
@@ -245,14 +245,14 @@ namespace tree {
             CPPUNIT_ASSERT( check_size( m, 2 ));
 
             CPPUNIT_ASSERT( !m.find(30) );
-            CPPUNIT_ASSERT( m.insert_key( 30, insert_functor<Map>() ) )    ; // value = 90
+            CPPUNIT_ASSERT( m.insert_with( 30, insert_functor<Map>() ) )    ; // value = 90
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
             CPPUNIT_ASSERT( m.find(30) );
 
-            CPPUNIT_ASSERT( !m.insert_key( 10, insert_functor<Map>() ) );
-            CPPUNIT_ASSERT( !m.insert_key( 25, insert_functor<Map>() ) );
-            CPPUNIT_ASSERT( !m.insert_key( 30, insert_functor<Map>() ) );
+            CPPUNIT_ASSERT( !m.insert_with( 10, insert_functor<Map>() ) );
+            CPPUNIT_ASSERT( !m.insert_with( 25, insert_functor<Map>() ) );
+            CPPUNIT_ASSERT( !m.insert_with( 30, insert_functor<Map>() ) );
 
             // ensure (new key)
             CPPUNIT_ASSERT( !m.find(27) );
index 46b53dd..aa09a1d 100644 (file)
@@ -139,7 +139,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, std::ref(func) ) )
+                            if ( rMap.insert_with( *it, std::ref(func) ) )
                                 ++m_nInsertSuccess;
                             else
                                 ++m_nInsertFailed;
@@ -149,7 +149,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, std::ref(func) ) )
+                            if ( rMap.insert_with( *it, std::ref(func) ) )
                                 ++m_nInsertSuccess;
                             else
                                 ++m_nInsertFailed;
index 44c6494..837570f 100644 (file)
@@ -301,9 +301,9 @@ namespace map2 {
             }
 
             template <typename K, typename Func>
-            bool insert_key( K const& key, Func func )
+            bool insert_with( K const& key, Func func )
             {
-                return base_class::insert_key( key, func ) != base_class::end();
+                return base_class::insert_with( key, func ) != base_class::end();
             }
 
             template <typename K>
@@ -339,9 +339,9 @@ namespace map2 {
             }
 
             template <typename K, typename Func>
-            bool insert_key( K const& key, Func func )
+            bool insert_with( K const& key, Func func )
             {
-                return base_class::insert_key( key, func ) != base_class::end();
+                return base_class::insert_with( key, func ) != base_class::end();
             }
 
             template <typename K>
@@ -374,9 +374,9 @@ namespace map2 {
             }
 
             template <typename K, typename Func>
-            bool insert_key( K const& key, Func func )
+            bool insert_with( K const& key, Func func )
             {
-                return base_class::insert_key( key, func ) != base_class::end();
+                return base_class::insert_with( key, func ) != base_class::end();
             }
 
             template <typename K>