Replace cds::ref/boost::ref with std::ref, remove cds::unref and cds/ref.h header
[libcds.git] / tests / test-hdr / map / hdr_cuckoo_map.h
index ccc7cfa910d72d2570299818bd4f44ed65627cdf..40310cf752675120e9413a86ff41f361378c9a29 100644 (file)
@@ -7,7 +7,7 @@
 #include "cppunit/cppunit_proxy.h"
 #include <cds/os/timer.h>
 #include <cds/opt/hash.h>
-#include <cds/ref.h>
+#include <functional>   // ref
 #include <algorithm>    // random_shuffle
 
 namespace cds { namespace container {}}
@@ -259,19 +259,19 @@ namespace map {
 
             // find test
             check_value chk(10);
-            CPPUNIT_ASSERT( m.find( 10, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find_with( 25, predicate(), boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find_with( 25, predicate(), std::ref(chk) ));
             chk.m_nExpected = 90;
-            CPPUNIT_ASSERT( m.find( 30, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 30, std::ref(chk) ));
             chk.m_nExpected = 54;
-            CPPUNIT_ASSERT( m.find( 27, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 27, std::ref(chk) ));
 
             ensureResult = m.ensure( 10, insert_functor<Map>() ) ;   // value = 50
             CPPUNIT_ASSERT( ensureResult.first );
             CPPUNIT_ASSERT( !ensureResult.second );
             chk.m_nExpected = 50;
-            CPPUNIT_ASSERT( m.find( 10, boost::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 10, std::ref(chk) ));
 
             // erase test
             CPPUNIT_ASSERT( !m.find(100) );
@@ -301,20 +301,20 @@ namespace map {
 
             CPPUNIT_ASSERT( !m.find(29) );
             CPPUNIT_ASSERT( m.insert(29, 290))
-            CPPUNIT_ASSERT( m.erase_with( 29, predicate(), boost::ref(ext)));
+            CPPUNIT_ASSERT( m.erase_with( 29, predicate(), std::ref(ext)));
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));
             CPPUNIT_ASSERT( nVal == 290 );
             nVal = -1;
-            CPPUNIT_ASSERT( !m.erase_with( 29, predicate(), boost::ref(ext)));
+            CPPUNIT_ASSERT( !m.erase_with( 29, predicate(), std::ref( ext ) ) );
             CPPUNIT_ASSERT( nVal == -1 );
 
-            CPPUNIT_ASSERT( m.erase( 30, boost::ref(ext)));
+            CPPUNIT_ASSERT( m.erase( 30, std::ref( ext ) ) );
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 2 ));
             CPPUNIT_ASSERT( nVal == 90 );
             nVal = -1;
-            CPPUNIT_ASSERT( !m.erase( 30, boost::ref(ext)));
+            CPPUNIT_ASSERT( !m.erase( 30, std::ref( ext ) ) );
             CPPUNIT_ASSERT( nVal == -1 );
 
             m.clear();
@@ -330,15 +330,15 @@ namespace map {
             CPPUNIT_ASSERT( check_size( m, 3 ));
 
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find( 126, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
             chk.m_nExpected = 731;
-            CPPUNIT_ASSERT( m.find_with( 137, predicate(), cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find_with( 137, predicate(), std::ref(chk) ));
             chk.m_nExpected = 941;
-            CPPUNIT_ASSERT( m.find( 149, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 149, std::ref(chk) ));
 
             CPPUNIT_ASSERT( !m.emplace(126, 621)) ; // already in map
             chk.m_nExpected = 0;
-            CPPUNIT_ASSERT( m.find( 126, cds::ref(chk) ));
+            CPPUNIT_ASSERT( m.find( 126, std::ref(chk) ));
             CPPUNIT_ASSERT( !m.empty() );
             CPPUNIT_ASSERT( check_size( m, 3 ));