2 // Boost.Pointer Container
4 // Copyright Thorsten Ottosen 2003-2005. Use, modification and
5 // distribution is subject to the Boost Software License, Version
6 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // For more information, see http://www.boost.org/libs/ptr_container/
12 #ifndef BOOST_PTR_CONTAINER_PTR_LIST_HPP
13 #define BOOST_PTR_CONTAINER_PTR_LIST_HPP
15 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
19 #include <boost/ptr_container/ptr_sequence_adapter.hpp>
28 class CloneAllocator = heap_clone_allocator,
29 class Allocator = std::allocator<void*>
31 class ptr_list : public
32 ptr_sequence_adapter< T,
33 std::list<void*,Allocator>,
36 typedef ptr_sequence_adapter< T,
37 std::list<void*,Allocator>,
41 typedef ptr_list<T,CloneAllocator,Allocator> this_type;
44 BOOST_PTR_CONTAINER_DEFINE_NON_INHERITED_MEMBERS( ptr_list,
49 using base_class::merge;
51 void merge( ptr_list& x )
53 merge( x, std::less<T>() );
56 template< typename Compare >
57 void merge( ptr_list& x, Compare comp )
59 this->c_private().merge( x.c_private(), void_ptr_indirect_fun<Compare,T>( comp ) );
64 sort( std::less<T>() );
67 template< typename Compare >
68 void sort( Compare comp )
70 this->c_private().sort( void_ptr_indirect_fun<Compare,T>( comp ) );
73 }; // class 'ptr_list'
75 //////////////////////////////////////////////////////////////////////////////
78 template< typename T, typename CA, typename A >
79 inline ptr_list<T,CA,A>* new_clone( const ptr_list<T,CA,A>& r )
81 return r.clone().release();
84 /////////////////////////////////////////////////////////////////////////
87 template< typename T, typename CA, typename A >
88 inline void swap( ptr_list<T,CA,A>& l, ptr_list<T,CA,A>& r )