#ifndef __CDS_CONTAINER_STRIPED_SET_STD_LIST_ADAPTER_H
#define __CDS_CONTAINER_STRIPED_SET_STD_LIST_ADAPTER_H
-#include <cds/container/striped_set/adapter.h>
-#include <cds/ref.h>
+#include <functional> // ref
#include <list>
#include <algorithm> // std::lower_bound
+#include <cds/container/striped_set/adapter.h>
//@cond
namespace cds { namespace container {
namespace cds { namespace intrusive { namespace striped_set {
/// std::list adapter for hash set bucket
- template <typename T, class Alloc, CDS_SPEC_OPTIONS>
- class adapt< std::list<T, Alloc>, CDS_OPTIONS >
+ template <typename T, class Alloc, typename... Options>
+ class adapt< std::list<T, Alloc>, Options... >
{
public:
typedef std::list<T, Alloc> container_type ; ///< underlying container type
private:
//@cond
- typedef typename cds::opt::details::make_comparator_from_option_list< value_type, CDS_OPTIONS >::type key_comparator;
+ typedef typename cds::opt::details::make_comparator_from_option_list< value_type, Options... >::type key_comparator;
typedef typename cds::opt::select<
typename cds::opt::value<
typename cds::opt::find_option<
cds::opt::copy_policy< cds::container::striped_set::move_item >
- , CDS_OPTIONS
+ , Options...
>::type
>::copy_policy
, cds::container::striped_set::copy_item, cds::container::striped_set::copy_item_policy<container_type>
if ( it == m_List.end() || key_comparator()( val, *it ) != 0 ) {
value_type newItem( val );
it = m_List.insert( it, newItem );
- cds::unref( f )( *it );
+ f( *it );
# ifdef __GLIBCXX__
++m_nSize;
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename... Args>
bool emplace( Args&&... args )
{
}
return false;
}
-# endif
template <typename Q, typename Func>
std::pair<bool, bool> ensure( const Q& val, Func func )
// insert new
value_type newItem( val );
it = m_List.insert( it, newItem );
- cds::unref( func )( true, *it, val );
+ func( true, *it, val );
# ifdef __GLIBCXX__
++m_nSize;
# endif
}
else {
// already exists
- cds::unref( func )( false, *it, val );
+ func( false, *it, val );
return std::make_pair( true, false );
}
}
return false;
// key exists
- cds::unref( f )( *it );
+ f( *it );
m_List.erase( it );
# ifdef __GLIBCXX__
--m_nSize;
return false;
// key exists
- cds::unref( f )( *it );
+ f( *it );
m_List.erase( it );
# ifdef __GLIBCXX__
--m_nSize;
return false;
// key exists
- cds::unref( f )( *it, val );
+ f( *it, val );
return true;
}
return false;
// key exists
- cds::unref( f )( *it, val );
+ f( *it, val );
return true;
}