fix doc example typo
[boost.git] / boost / ptr_container / ptr_deque.hpp
blob0223fc79a4ca1a08173e70d88b2832c1f30c8ff2
1 //
2 // Boost.Pointer Container
3 //
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)
8 //
9 // For more information, see http://www.boost.org/libs/ptr_container/
12 #ifndef BOOST_PTR_CONTAINER_PTR_DEQUE_HPP
13 #define BOOST_PTR_CONTAINER_PTR_DEQUE_HPP
15 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 # pragma once
17 #endif
19 #include <deque>
20 #include <boost/ptr_container/ptr_sequence_adapter.hpp>
22 namespace boost
25 template
27 class T,
28 class CloneAllocator = heap_clone_allocator,
29 class Allocator = std::allocator<void*>
31 class ptr_deque : public
32 ptr_sequence_adapter< T,
33 std::deque<void*,Allocator>,
34 CloneAllocator >
36 typedef ptr_sequence_adapter< T,
37 std::deque<void*,Allocator>,
38 CloneAllocator >
39 base_class;
41 typedef ptr_deque<T,CloneAllocator,Allocator> this_type;
43 public:
45 BOOST_PTR_CONTAINER_DEFINE_SEQEUENCE_MEMBERS( ptr_deque,
46 base_class,
47 this_type )
50 //////////////////////////////////////////////////////////////////////////////
51 // clonability
53 template< typename T, typename CA, typename A >
54 inline ptr_deque<T,CA,A>* new_clone( const ptr_deque<T,CA,A>& r )
56 return r.clone().release();
59 /////////////////////////////////////////////////////////////////////////
60 // swap
62 template< typename T, typename CA, typename A >
63 inline void swap( ptr_deque<T,CA,A>& l, ptr_deque<T,CA,A>& r )
65 l.swap(r);
69 #endif