- template <typename Q>
- static node_type * alloc_node(Q const& v )
- {
- return cxx_node_allocator().New( v );
- }
-
- 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 )
- {
- return base_class::find_with( val, typename maker::template predicate_wrapper<Less>::type(),
- [&f]( node_type& item, Q& val ) { f(item.m_Value, val) ; } );
- }
-
- 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 );
- }
-
- 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
-
- protected:
- /// Forward iterator
- /**
- \p IsConst - constness boolean flag
-
- The forward iterator for a split-list has the following features:
- - it has no post-increment operator
- - it depends on underlying ordered list iterator
- - The iterator object cannot be moved across thread boundary since it contains GC's guard that is thread-private GC data.
- - Iterator ensures thread-safety even if you delete the item that iterator points to. However, in case of concurrent
- deleting operations it is no guarantee that you iterate all item in the split-list.
-
- Therefore, the use of iterators in concurrent environment is not good idea. Use it for debug purpose only.
- */