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 11885552fd406121a39496e3920f61f0ff3f07cc..826b1bb54fac825ca19aaf5dd4d88b351bf5726d 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 6ad87c1188b09747640deace1ef6f0eed45b9cab..1e8c1ae7ac84a92b90bc5734c15a78f0600e91e9 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 16b32a399a3e108199d13cf1808ff089def628af..1d78da4bdf37891fc0f644468a8f8225abc599c7 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 e8b83f7a7cbc001194618e5465ae86ea95454784..579b475e9e460031ed8cb167837d6b6b6f7b91bd 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 a31103e4949be5c38b61cb80e183431e39356d52..6218f695538e9bc90fc01b393f9af620e533f803 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 0d31172642d871f76c4d452db7644f8f8e3c8292..9d0bb2ac5e59fcfaeef1a68621e616b992e6c63d 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 b5a9df89d8f092551e26d52206e322a297afa52c..66a46574facb8e6fbe6bba0ee0e916945d19cf26 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 40f234f00fb497f001261a8e57cafc56a7627c9b..6c7fd54ce398a52efbe80f2eb3fd72a7e700036e 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 15a14dfa1488718bd72349841d6331814da5c56b..3634a704f7c2ea9e03e1ab2473c4c8693a72d367 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 7545e48c7fcb0b0b1f8086f4e209b1da3072591c..4733f99998b4f5efd6fddce992ce9a55a954325e 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 a090a6d46d270be3dfba6bcb3b580453ac8c1f71..ba411b73521e0a266d710931a046210f389d6383 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 cfa193e8e6b0ea19891156921bfa163ed56323c7..e541b178c218687c48ab84128bd16ca58ae44072 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 8888759a8980aeae18bb92519ebb02b91ef29e79..5dc469b8e65d70736cae77d023477a50644ca293 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 916de56732317a5f84bfaaf848bc4b1db3984ee1..7745b7ea1f108cad3e2a1ba4401ca244d90eb5c0 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 74192804635fcf82c618c0f6367e2e00e307402d..e47917c3e3daa9d7220aa24febd6d1d092a6bf9a 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 de219d16253c6ae3f61c0c3d8176e256ca880228..86040560d274ba43771737e8148453534cdf5002 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 ba7efc5ce3148fe44759250d766ca7fa8bb7383e..0922ef398d7758470e95593ae8ce9b0b1fc95f55 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 3354a1f971d0d6e968cef654a2afe4f4616a1c08..d0aac44858b4df873e974763569a22392d4c8164 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 ce9a2325328b1cb264985577db9f60057a3f59c0..8969d5bef6aa13444f32ab551b4c191ad86c34f3 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 40310cf752675120e9413a86ff41f361378c9a29..92065c0884af4db603b5dc0753d0c084c032438e 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 1441b46cf1feb419b8d700b62fd9f1506d2a9882..ec6ed42c9a812da9951bbd7ad8a6d44d09186a89 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 7d5db329be76882e75ec90a82596b768a790f56d..e21aaaa333b7222b5925871b2a9d378527625cf1 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 5474902760b57c6c9abc8fac391eb927f8ed7624..06b3c87f0fe445c3a26f85f2f3b1245c24cd99f4 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 3a8509a2044b295420bc170f517bb24f46e7f457..e62dcf3b09b697e0daf67f8d35d83875d1e15ee0 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 e4acdf8b5ef9653bc93684ed76fc33160414a36e..d51a08f82986eb4bac4684fa30555e74e412bbc6 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 d4849aa23749c3d7a4f44b81998012e4db574bac..d2c9051948bce05abb7e85528eaa0ae323d8d5a3 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 46b53ddd1f3449e5f6329eeb579017fb8992cc46..aa09a1dd726394b659aec552e16dc84d0899274c 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 44c6494da9468b6c462d7af8644fb93a436842fc..837570f6690ff256bb19da89813e7ea0e4cb2c42 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>