return cxx_allocator().New( key, val );
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename K, typename... Args>
static node_type * alloc_node( K&& key, Args&&... args )
{
return cxx_allocator().MoveNew( std::forward<K>(key), std::forward<Args>(args)...);
}
-# endif
static void free_node( node_type * pNode )
{
return ensure_at( head(), key, f );
}
-# ifdef CDS_EMPLACE_SUPPORT
/// Inserts data of type \ref mapped_type constructed with <tt>std::forward<Args>(args)...</tt>
/**
Returns \p true if inserting successful, \p false otherwise.
-
- @note This function is available only for compiler that supports
- variadic template and move semantics
*/
template <typename K, typename... Args>
bool emplace( K&& key, Args&&... args )
{
return emplace_at( head(), std::forward<K>(key), std::forward<Args>(args)... );
}
-# endif
/// Deletes \p key from the list
/** \anchor cds_nonintrusive_MichaelKVList_hp_erase_val
return false;
}
-# ifdef CDS_EMPLACE_SUPPORT
template <typename K, typename... Args>
bool emplace_at( head_type& refHead, K&& key, Args&&... args )
{
return insert_node_at( refHead, alloc_node( std::forward<K>(key), std::forward<Args>(args)... ));
}
-# endif
template <typename K, typename Func>
std::pair<bool, bool> ensure_at( head_type& refHead, const K& key, Func f )