If the option is not specified, the \p %opt::less is used.
- \p opt::less - specifies binary predicate used for key comparison. Default is \p std::less<T>.
- \p opt::item_counter - item counter type. Default is \p atomicity::item_counter since some operation on the counter is performed
- without locks. Note that item counting is an essential part of the map algorithm, so dummy counter
+ without locks. Note that item counting is an essential part of the map algorithm, so dummy counter
like as \p atomicity::empty_item_counter is not suitable.
- \p opt::allocator - the allocator type using for memory allocation of bucket table and lock array. Default is \ref CDS_DEFAULT_ALLOCATOR.
- \p opt::resizing_policy - the resizing policy that is a functor that decides when to resize the hash map.
template <typename K>
bool insert( K const& key )
{
- return insert_key( key, [](value_type&){} );
+ return insert_with( key, [](value_type&){} );
}
/// Inserts new node
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
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 );
}
,typename Bucket = bucket_type, typename = typename std::enable_if< Bucket::has_erase_with >::type >
bool erase_with( K const& key, Less pred, Func f )
{
+ CDS_UNUSED( pred );
return base_class::erase_with( key, cds::details::predicate_wrapper< value_type, Less, key_accessor >(), f );
}
,typename Bucket = bucket_type, typename = typename std::enable_if< Bucket::has_find_with >::type >
bool find_with( K const& key, Less pred, Func f )
{
+ CDS_UNUSED( pred );
return base_class::find_with( key, cds::details::predicate_wrapper< value_type, Less, key_accessor >(),
[&f]( value_type& pair, K const& ) mutable { f(pair); } );
}
,typename Bucket = bucket_type, typename = typename std::enable_if< Bucket::has_find_with >::type >
bool find_with( K const& key, Less pred )
{
+ CDS_UNUSED( pred );
return base_class::find_with( key, cds::details::predicate_wrapper< value_type, Less, key_accessor >() );
}