1 ++++++++++++++++++++++++++++++++++
2 |Boost| Pointer Container Library
3 ++++++++++++++++++++++++++++++++++
5 .. |Boost| image:: boost.png
10 A ``ptr_deque<T>`` is a pointer container that uses an underlying ``std:deque<void*>``
11 to store the pointers.
15 - `reversible_ptr_container <reversible_ptr_container.html>`_
17 - `ptr_sequence_adapter <ptr_sequence_adapter.html>`_
19 - `ptr_vector <ptr_vector.html>`_
20 - `ptr_list <ptr_list.html>`_
22 - `ptr_array <ptr_array.html>`_
26 - `home <ptr_container.html>`_
27 - `reference <reference.html>`_
40 class CloneAllocator = heap_clone_allocator
41 class Allocator = std::allocator<void*>
43 class ptr_deque : public ptr_sequence_adapter
46 std::deque<void*,Allocator>,
51 public: // `element access`_
52 T& operator[]( size_type n );
53 const T& operator[]( size_type n ) const;
55 const T& at( size_type n ) const;
58 void push_front( T* x );
60 void push_front( std::auto_ptr<U> x );
61 auto_type pop_front();
63 public: // `pointer container requirements`_
64 auto_type replace( size_type idx, T* x );
66 auto_type replace( size_type idx, std::auto_ptr<U> x );
67 bool is_null( size_type idx ) const;
71 } // namespace 'boost'
74 .. _`reversible_ptr_container`: reversible_ptr_container.html
76 .. _`ptr_sequence_adapter`: ptr_sequence_adapter.html
86 - ``void push_front( T* x );``
88 - Requirements: ``x != 0``
90 - Effects: Inserts the pointer into container and takes ownership of it
92 - Throws: ``bad_pointer`` if ``x == 0``
94 - Exception safety: Strong guarantee
96 - ``template< class U > void push_front( std::auto_ptr<U> x );``
98 - Effects: ``push_front( x.release() );``
101 - ``void push_front( const T& x );``
103 - Effects: push_front( allocate_clone( x ) );
105 - Exception safety: Strong guarantee
107 - ``auto_type pop_front():``
109 - Requirements:``not empty()``
111 - Effects: Removes the first element in the container
113 - Postconditions: ``size()`` is one less
115 - Throws: ``bad_ptr_container_operation`` if ``empty() == true``
117 - Exception safety: Strong guarantee
120 .. _`element access`:
122 Semantics: element access
123 ^^^^^^^^^^^^^^^^^^^^^^^^^
125 - ``T& operator[]( size_type n );``
126 - ``const T& operator[]( size_type n ) const;``
128 - Requirements: ``n < size()``
130 - Effects: Returns a reference to the ``n``'th element
134 - ``T& at( size_type n );``
135 - ``const T& at( size_type n ) const;``
137 - Requirements: ``n < size()``
139 - Effects: Returns a reference to the ``n``'th element
141 - Throws: ``bad_index`` if ``n >=size()``
144 .. _`pointer container requirements`:
146 Semantics: pointer container requirements
147 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
149 - ``auto_type replace( size_type idx, T* x );``
151 - Requirements: `` x != 0 and idx < size()``
153 - Effects: returns the object indexed by ``idx`` and replaces it with ``x``.
155 - Throws: ``bad_index`` if ``idx >= size()`` and ``bad_pointer`` if ``x == 0``.
157 - Exception safety: Strong guarantee
159 - ``template< class U > auto_type replace( size_type idx, std::auto_ptr<U> x );``
161 - Effects: ``return replace( idx, x.release() );``
163 - ``bool is_null( size_type idx ) const;``
165 - Requirements: ``idx < size()``
167 - Effects: returns whether the pointer at index ``idx`` is null
169 - Exception safety: Nothrow guarantee
175 :Copyright: Thorsten Ottosen 2004-2006. Use, modification and distribution is subject to the Boost Software License, Version 1.0 (see LICENSE_1_0.txt__).
177 __ http://www.boost.org/LICENSE_1_0.txt