- protected:
- //@cond
- template <typename K>
- static node_type * alloc_node(const K& key)
- {
- return cxx_allocator().New( key );
- }
-
- template <typename K, typename V>
- static node_type * alloc_node( const K& key, const V& val )
- {
- return cxx_allocator().New( key, val );
- }
-
- 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)...);
- }
-
- static void free_node( node_type * pNode )
- {
- cxx_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;
-
- head_type& head()
- {
- return base_class::m_pHead;
- }
-
- head_type& head() const
- {
- return const_cast<head_type&>( base_class::m_pHead );
- }
- //@endcond