- protected:
- //@cond
- template <typename Q>
- static node_type * alloc_node(Q const& v )
- {
- return cxx_node_allocator().New( v );
- }
-
- template <typename... Args>
- static node_type * alloc_node( Args&&... args )
- {
- return cxx_node_allocator().MoveNew( std::forward<Args>( args )... );
- }
-
- static void free_node( node_type * pNode )
- {
- cxx_node_allocator().Delete( pNode );
- }
-
- template <typename Q, typename Func>
- bool find_( Q& val, Func f )
- {
- return base_class::find( val, [&f]( node_type& item, Q& val ) { f(item.m_Value, val) ; } );
- }
-
- template <typename Q, typename Less, typename Func>
- bool find_with_( Q& val, Less pred, Func f )
- {
- CDS_UNUSED( pred );
- return base_class::find_with( val, typename maker::template predicate_wrapper<Less>::type(),
- [&f]( node_type& item, Q& val ) { f(item.m_Value, val) ; } );
- }
-
- struct node_disposer {
- void operator()( node_type * pNode )
- {
- free_node( pNode );
- }
- };
- typedef std::unique_ptr< node_type, node_disposer > scoped_node_ptr;
-
- bool insert_node( node_type * pNode )
- {
- assert( pNode != nullptr );
- scoped_node_ptr p(pNode);
-
- if ( base_class::insert( *pNode )) {
- p.release();
- return true;
- }
- return false;
- }
-
- //@endcond
-