Replace cds::ref/boost::ref with std::ref, remove cds::unref and cds/ref.h header
[libcds.git] / tests / test-hdr / set / hdr_cuckoo_set.h
index 442dd7dec3298126d54a091446cc524d21792479..c3f269a0df2766bc0b1006d1257db5cbf60e57ad 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <cds/opt/hash.h>
 #include <cds/os/timer.h>
-#include <cds/ref.h>
+#include <functional>   // ref
 #include <algorithm>    // random_shuffle
 
 // forward namespace declaration
@@ -353,7 +353,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 20;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
                 CPPUNIT_ASSERT( f.m_found.nFindCount == 1 );
@@ -361,7 +361,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 20;
-                CPPUNIT_ASSERT( s.find_with( key, pred, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find_with( key, pred, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
                 CPPUNIT_ASSERT( f.m_found.nFindCount == 1 );
@@ -376,7 +376,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 25;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 25 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 2500 );
             }
@@ -385,7 +385,7 @@ namespace set {
             key = 10;
             {
                 copy_found<item> f;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 10 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 10 );
                 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 0 );
@@ -397,7 +397,7 @@ namespace set {
             CPPUNIT_ASSERT( check_size( s, 3 ));
             {
                 copy_found<item> f;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 10 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 10 );
                 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 1 );
@@ -411,7 +411,7 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 13;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 13 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 1300 );
                 CPPUNIT_ASSERT( f.m_found.nEnsureCount == 0 );
@@ -439,12 +439,12 @@ namespace set {
             CPPUNIT_ASSERT( s.find(20) );
             {
                 copy_found<item> f;
-                CPPUNIT_ASSERT( s.erase( 20, boost::ref(f) ));
+                CPPUNIT_ASSERT( s.erase( 20, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 20 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 25 );
 
                 CPPUNIT_ASSERT( s.insert(235))
-                    CPPUNIT_ASSERT( s.erase_with( 235, pred, boost::ref(f) ));
+                    CPPUNIT_ASSERT( s.erase_with( 235, pred, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 235 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 235 );
             }
@@ -470,17 +470,17 @@ namespace set {
             {
                 copy_found<item> f;
                 key = 151;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 151 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 151 );
 
                 key = 174;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 174 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 471 );
 
                 key = 190;
-                CPPUNIT_ASSERT( s.find( key, boost::ref(f) ) );
+                CPPUNIT_ASSERT( s.find( key, std::ref( f ) ) );
                 CPPUNIT_ASSERT( f.m_found.nKey == 190 );
                 CPPUNIT_ASSERT( f.m_found.nVal == 91 );
             }