#include <cds/opt/hash.h>
#include <cds/os/timer.h>
-#include <cds/ref.h>
+#include <functional> // ref
#include <algorithm> // random_shuffle
// forward namespace declaration
{
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 );
{
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 );
{
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 );
}
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 );
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 );
{
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 );
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 );
}
{
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 );
}