Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/container/static_vector.hpp @ 101:c530137014c0
Update Boost headers (1.58.0)
author | Chris Cannam |
---|---|
date | Mon, 07 Sep 2015 11:12:49 +0100 |
parents | 2665513ce2d3 |
children |
comparison
equal
deleted
inserted
replaced
100:793467b5e61c | 101:c530137014c0 |
---|---|
1 // Boost.Container static_vector | 1 // Boost.Container static_vector |
2 // | 2 // |
3 // Copyright (c) 2012-2013 Adam Wulkiewicz, Lodz, Poland. | 3 // Copyright (c) 2012-2013 Adam Wulkiewicz, Lodz, Poland. |
4 // Copyright (c) 2011-2013 Andrew Hundt. | 4 // Copyright (c) 2011-2013 Andrew Hundt. |
5 // Copyright (c) 2013-2014 Ion Gaztanaga | |
5 // | 6 // |
6 // Use, modification and distribution is subject to the Boost Software License, | 7 // Use, modification and distribution is subject to the Boost Software License, |
7 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | 8 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
8 // http://www.boost.org/LICENSE_1_0.txt) | 9 // http://www.boost.org/LICENSE_1_0.txt) |
9 | 10 |
10 #ifndef BOOST_CONTAINER_STATIC_VECTOR_HPP | 11 #ifndef BOOST_CONTAINER_STATIC_VECTOR_HPP |
11 #define BOOST_CONTAINER_STATIC_VECTOR_HPP | 12 #define BOOST_CONTAINER_STATIC_VECTOR_HPP |
12 | 13 |
13 #if defined(_MSC_VER) | 14 #ifndef BOOST_CONFIG_HPP |
15 # include <boost/config.hpp> | |
16 #endif | |
17 | |
18 #if defined(BOOST_HAS_PRAGMA_ONCE) | |
14 # pragma once | 19 # pragma once |
15 #endif | 20 #endif |
16 | 21 |
17 #include <boost/container/detail/config_begin.hpp> | 22 #include <boost/container/detail/config_begin.hpp> |
18 | 23 #include <boost/container/detail/workaround.hpp> |
24 #include <boost/container/detail/type_traits.hpp> | |
19 #include <boost/container/vector.hpp> | 25 #include <boost/container/vector.hpp> |
20 #include <boost/aligned_storage.hpp> | 26 |
27 #include <cstddef> | |
28 #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) | |
29 #include <initializer_list> | |
30 #endif | |
21 | 31 |
22 namespace boost { namespace container { | 32 namespace boost { namespace container { |
33 | |
34 #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED | |
23 | 35 |
24 namespace container_detail { | 36 namespace container_detail { |
25 | 37 |
26 template<class T, std::size_t N> | 38 template<class T, std::size_t N> |
27 class static_storage_allocator | 39 class static_storage_allocator |
28 { | 40 { |
29 public: | 41 public: |
30 typedef T value_type; | 42 typedef T value_type; |
31 | 43 |
32 static_storage_allocator() BOOST_CONTAINER_NOEXCEPT | 44 static_storage_allocator() BOOST_NOEXCEPT_OR_NOTHROW |
33 {} | 45 {} |
34 | 46 |
35 static_storage_allocator(const static_storage_allocator &) BOOST_CONTAINER_NOEXCEPT | 47 static_storage_allocator(const static_storage_allocator &) BOOST_NOEXCEPT_OR_NOTHROW |
36 {} | 48 {} |
37 | 49 |
38 static_storage_allocator & operator=(const static_storage_allocator &) BOOST_CONTAINER_NOEXCEPT | 50 static_storage_allocator & operator=(const static_storage_allocator &) BOOST_NOEXCEPT_OR_NOTHROW |
39 {} | 51 {} |
40 | 52 |
41 T* internal_storage() const BOOST_CONTAINER_NOEXCEPT | 53 T* internal_storage() const BOOST_NOEXCEPT_OR_NOTHROW |
42 { return const_cast<T*>(static_cast<const T*>(static_cast<const void*>(&storage))); } | 54 { return const_cast<T*>(static_cast<const T*>(static_cast<const void*>(&storage))); } |
43 | 55 |
44 T* internal_storage() BOOST_CONTAINER_NOEXCEPT | 56 T* internal_storage() BOOST_NOEXCEPT_OR_NOTHROW |
45 { return static_cast<T*>(static_cast<void*>(&storage)); } | 57 { return static_cast<T*>(static_cast<void*>(&storage)); } |
46 | 58 |
47 static const std::size_t internal_capacity = N; | 59 static const std::size_t internal_capacity = N; |
48 | 60 |
49 typedef boost::container::container_detail::version_type<static_storage_allocator, 0> version; | 61 typedef boost::container::container_detail::version_type<static_storage_allocator, 0> version; |
50 | 62 |
51 friend bool operator==(const static_storage_allocator &, const static_storage_allocator &) BOOST_CONTAINER_NOEXCEPT | 63 friend bool operator==(const static_storage_allocator &, const static_storage_allocator &) BOOST_NOEXCEPT_OR_NOTHROW |
52 { return false; } | 64 { return false; } |
53 | 65 |
54 friend bool operator!=(const static_storage_allocator &, const static_storage_allocator &) BOOST_CONTAINER_NOEXCEPT | 66 friend bool operator!=(const static_storage_allocator &, const static_storage_allocator &) BOOST_NOEXCEPT_OR_NOTHROW |
55 { return true; } | 67 { return true; } |
56 | 68 |
57 private: | 69 private: |
58 typename boost::aligned_storage | 70 typename aligned_storage<sizeof(T)*N, alignment_of<T>::value>::type storage; |
59 <sizeof(T)*N, boost::alignment_of<T>::value>::type storage; | |
60 }; | 71 }; |
61 | 72 |
62 } //namespace container_detail { | 73 } //namespace container_detail { |
63 | 74 |
64 /** | 75 #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED |
65 * @defgroup static_vector_non_member static_vector non-member functions | 76 |
66 */ | 77 //! |
67 | 78 //!@brief A variable-size array container with fixed capacity. |
68 /** | 79 //! |
69 * @brief A variable-size array container with fixed capacity. | 80 //!static_vector is a sequence container like boost::container::vector with contiguous storage that can |
70 * | 81 //!change in size, along with the static allocation, low overhead, and fixed capacity of boost::array. |
71 * static_vector is a sequence container like boost::container::vector with contiguous storage that can | 82 //! |
72 * change in size, along with the static allocation, low overhead, and fixed capacity of boost::array. | 83 //!A static_vector is a sequence that supports random access to elements, constant time insertion and |
73 * | 84 //!removal of elements at the end, and linear time insertion and removal of elements at the beginning or |
74 * A static_vector is a sequence that supports random access to elements, constant time insertion and | 85 //!in the middle. The number of elements in a static_vector may vary dynamically up to a fixed capacity |
75 * removal of elements at the end, and linear time insertion and removal of elements at the beginning or | 86 //!because elements are stored within the object itself similarly to an array. However, objects are |
76 * in the middle. The number of elements in a static_vector may vary dynamically up to a fixed capacity | 87 //!initialized as they are inserted into static_vector unlike C arrays or std::array which must construct |
77 * because elements are stored within the object itself similarly to an array. However, objects are | 88 //!all elements on instantiation. The behavior of static_vector enables the use of statically allocated |
78 * initialized as they are inserted into static_vector unlike C arrays or std::array which must construct | 89 //!elements in cases with complex object lifetime requirements that would otherwise not be trivially |
79 * all elements on instantiation. The behavior of static_vector enables the use of statically allocated | 90 //!possible. |
80 * elements in cases with complex object lifetime requirements that would otherwise not be trivially | 91 //! |
81 * possible. | 92 //!@par Error Handling |
82 * | 93 //! Insertion beyond the capacity result in throwing std::bad_alloc() if exceptions are enabled or |
83 * @par Error Handling | 94 //! calling throw_bad_alloc() if not enabled. |
84 * Insertion beyond the capacity result in throwing std::bad_alloc() if exceptions are enabled or | 95 //! |
85 * calling throw_bad_alloc() if not enabled. | 96 //! std::out_of_range is thrown if out of bound access is performed in <code>at()</code> if exceptions are |
86 * | 97 //! enabled, throw_out_of_range() if not enabled. |
87 * std::out_of_range is thrown if out of bound access is performed in `at()` if exceptions are | 98 //! |
88 * enabled, throw_out_of_range() if not enabled. | 99 //!@tparam Value The type of element that will be stored. |
89 * | 100 //!@tparam Capacity The maximum number of elements static_vector can store, fixed at compile time. |
90 * @tparam Value The type of element that will be stored. | |
91 * @tparam Capacity The maximum number of elements static_vector can store, fixed at compile time. | |
92 */ | |
93 template <typename Value, std::size_t Capacity> | 101 template <typename Value, std::size_t Capacity> |
94 class static_vector | 102 class static_vector |
95 : public vector<Value, container_detail::static_storage_allocator<Value, Capacity> > | 103 : public vector<Value, container_detail::static_storage_allocator<Value, Capacity> > |
96 { | 104 { |
97 typedef vector<Value, container_detail::static_storage_allocator<Value, Capacity> > base_t; | 105 #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED |
98 | 106 typedef vector<Value, container_detail::static_storage_allocator<Value, Capacity> > base_t; |
99 BOOST_COPYABLE_AND_MOVABLE(static_vector) | 107 |
108 BOOST_COPYABLE_AND_MOVABLE(static_vector) | |
100 | 109 |
101 template<class U, std::size_t OtherCapacity> | 110 template<class U, std::size_t OtherCapacity> |
102 friend class static_vector; | 111 friend class static_vector; |
112 | |
113 #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED | |
103 | 114 |
104 public: | 115 public: |
105 //! @brief The type of elements stored in the container. | 116 //! @brief The type of elements stored in the container. |
106 typedef typename base_t::value_type value_type; | 117 typedef typename base_t::value_type value_type; |
107 //! @brief The unsigned integral type used by the container. | 118 //! @brief The unsigned integral type used by the container. |
130 //! @par Throws | 141 //! @par Throws |
131 //! Nothing. | 142 //! Nothing. |
132 //! | 143 //! |
133 //! @par Complexity | 144 //! @par Complexity |
134 //! Constant O(1). | 145 //! Constant O(1). |
135 static_vector() BOOST_CONTAINER_NOEXCEPT | 146 static_vector() BOOST_NOEXCEPT_OR_NOTHROW |
136 : base_t() | 147 : base_t() |
137 {} | 148 {} |
138 | 149 |
139 //! @pre <tt>count <= capacity()</tt> | 150 //! @pre <tt>count <= capacity()</tt> |
140 //! | 151 //! |
141 //! @brief Constructs a static_vector containing count value initialized values. | 152 //! @brief Constructs a static_vector containing count value initialized values. |
142 //! | 153 //! |
143 //! @param count The number of values which will be contained in the container. | 154 //! @param count The number of values which will be contained in the container. |
144 //! | 155 //! |
145 //! @par Throws | 156 //! @par Throws |
146 //! If Value's default constructor throws. | 157 //! If Value's value initialization throws. |
147 //! | 158 //! |
148 //! @par Complexity | 159 //! @par Complexity |
149 //! Linear O(N). | 160 //! Linear O(N). |
150 explicit static_vector(size_type count) | 161 explicit static_vector(size_type count) |
151 : base_t(count) | 162 : base_t(count) |
152 {} | 163 {} |
153 | 164 |
154 //! @pre <tt>count <= capacity()</tt> | 165 //! @pre <tt>count <= capacity()</tt> |
155 //! | 166 //! |
156 //! @brief Constructs a static_vector containing count value initialized values. | 167 //! @brief Constructs a static_vector containing count default initialized values. |
157 //! | 168 //! |
158 //! @param count The number of values which will be contained in the container. | 169 //! @param count The number of values which will be contained in the container. |
159 //! | 170 //! |
160 //! @par Throws | 171 //! @par Throws |
161 //! If Value's default constructor throws. | 172 //! If Value's default initialization throws. |
162 //! | 173 //! |
163 //! @par Complexity | 174 //! @par Complexity |
164 //! Linear O(N). | 175 //! Linear O(N). |
165 //! | 176 //! |
166 //! @par Note | 177 //! @par Note |
202 template <typename Iterator> | 213 template <typename Iterator> |
203 static_vector(Iterator first, Iterator last) | 214 static_vector(Iterator first, Iterator last) |
204 : base_t(first, last) | 215 : base_t(first, last) |
205 {} | 216 {} |
206 | 217 |
218 #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) | |
219 //! @pre | |
220 //! @li <tt>distance(il.begin(), il.end()) <= capacity()</tt> | |
221 //! | |
222 //! @brief Constructs a static_vector containing copy of a range <tt>[il.begin(), il.end())</tt>. | |
223 //! | |
224 //! @param il std::initializer_list with values to initialize vector. | |
225 //! | |
226 //! @par Throws | |
227 //! If Value's constructor taking a dereferenced std::initializer_list throws. | |
228 //! | |
229 //! @par Complexity | |
230 //! Linear O(N). | |
231 static_vector(std::initializer_list<value_type> il) | |
232 : base_t(il) | |
233 {} | |
234 #endif | |
235 | |
207 //! @brief Constructs a copy of other static_vector. | 236 //! @brief Constructs a copy of other static_vector. |
208 //! | 237 //! |
209 //! @param other The static_vector which content will be copied to this one. | 238 //! @param other The static_vector which content will be copied to this one. |
210 //! | 239 //! |
211 //! @par Throws | 240 //! @par Throws |
227 //! If Value's copy constructor throws. | 256 //! If Value's copy constructor throws. |
228 //! | 257 //! |
229 //! @par Complexity | 258 //! @par Complexity |
230 //! Linear O(N). | 259 //! Linear O(N). |
231 template <std::size_t C> | 260 template <std::size_t C> |
232 static_vector(static_vector<value_type, C> const& other) : base_t(other) {} | 261 static_vector(static_vector<value_type, C> const& other) |
262 : base_t(other) | |
263 {} | |
264 | |
265 //! @brief Move constructor. Moves Values stored in the other static_vector to this one. | |
266 //! | |
267 //! @param other The static_vector which content will be moved to this one. | |
268 //! | |
269 //! @par Throws | |
270 //! @li If \c has_nothrow_move<Value>::value is \c true and Value's move constructor throws. | |
271 //! @li If \c has_nothrow_move<Value>::value is \c false and Value's copy constructor throws. | |
272 //! | |
273 //! @par Complexity | |
274 //! Linear O(N). | |
275 static_vector(BOOST_RV_REF(static_vector) other) | |
276 : base_t(BOOST_MOVE_BASE(base_t, other)) | |
277 {} | |
278 | |
279 //! @pre <tt>other.size() <= capacity()</tt> | |
280 //! | |
281 //! @brief Move constructor. Moves Values stored in the other static_vector to this one. | |
282 //! | |
283 //! @param other The static_vector which content will be moved to this one. | |
284 //! | |
285 //! @par Throws | |
286 //! @li If \c has_nothrow_move<Value>::value is \c true and Value's move constructor throws. | |
287 //! @li If \c has_nothrow_move<Value>::value is \c false and Value's copy constructor throws. | |
288 //! | |
289 //! @par Complexity | |
290 //! Linear O(N). | |
291 template <std::size_t C> | |
292 static_vector(BOOST_RV_REF_BEG static_vector<value_type, C> BOOST_RV_REF_END other) | |
293 : base_t(BOOST_MOVE_BASE(typename static_vector<value_type BOOST_MOVE_I C>::base_t, other)) | |
294 {} | |
233 | 295 |
234 //! @brief Copy assigns Values stored in the other static_vector to this one. | 296 //! @brief Copy assigns Values stored in the other static_vector to this one. |
235 //! | 297 //! |
236 //! @param other The static_vector which content will be copied to this one. | 298 //! @param other The static_vector which content will be copied to this one. |
237 //! | 299 //! |
240 //! | 302 //! |
241 //! @par Complexity | 303 //! @par Complexity |
242 //! Linear O(N). | 304 //! Linear O(N). |
243 static_vector & operator=(BOOST_COPY_ASSIGN_REF(static_vector) other) | 305 static_vector & operator=(BOOST_COPY_ASSIGN_REF(static_vector) other) |
244 { | 306 { |
245 base_t::operator=(static_cast<base_t const&>(other)); | 307 return static_cast<static_vector&>(base_t::operator=(static_cast<base_t const&>(other))); |
246 return *this; | |
247 } | 308 } |
248 | 309 |
310 #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) | |
311 //! @brief Copy assigns Values stored in std::initializer_list to *this. | |
312 //! | |
313 //! @param il The std::initializer_list which content will be copied to this one. | |
314 //! | |
315 //! @par Throws | |
316 //! If Value's copy constructor or copy assignment throws. | |
317 //! | |
318 //! @par Complexity | |
319 //! Linear O(N). | |
320 static_vector & operator=(std::initializer_list<value_type> il) | |
321 { return static_cast<static_vector&>(base_t::operator=(il)); } | |
322 #endif | |
323 | |
249 //! @pre <tt>other.size() <= capacity()</tt> | 324 //! @pre <tt>other.size() <= capacity()</tt> |
250 //! | 325 //! |
251 //! @brief Copy assigns Values stored in the other static_vector to this one. | 326 //! @brief Copy assigns Values stored in the other static_vector to this one. |
252 //! | 327 //! |
253 //! @param other The static_vector which content will be copied to this one. | 328 //! @param other The static_vector which content will be copied to this one. |
256 //! If Value's copy constructor or copy assignment throws. | 331 //! If Value's copy constructor or copy assignment throws. |
257 //! | 332 //! |
258 //! @par Complexity | 333 //! @par Complexity |
259 //! Linear O(N). | 334 //! Linear O(N). |
260 template <std::size_t C> | 335 template <std::size_t C> |
261 // TEMPORARY WORKAROUND | |
262 #if defined(BOOST_NO_RVALUE_REFERENCES) | |
263 static_vector & operator=(::boost::rv< static_vector<value_type, C> > const& other) | |
264 #else | |
265 static_vector & operator=(static_vector<value_type, C> const& other) | 336 static_vector & operator=(static_vector<value_type, C> const& other) |
266 #endif | |
267 { | 337 { |
268 base_t::operator=(static_cast<static_vector<value_type, C> const&>(other)); | 338 return static_cast<static_vector&>(base_t::operator= |
269 return *this; | 339 (static_cast<typename static_vector<value_type, C>::base_t const&>(other))); |
270 } | 340 } |
271 | 341 |
272 //! @brief Move constructor. Moves Values stored in the other static_vector to this one. | 342 //! @brief Move assignment. Moves Values stored in the other static_vector to this one. |
273 //! | 343 //! |
274 //! @param other The static_vector which content will be moved to this one. | 344 //! @param other The static_vector which content will be moved to this one. |
275 //! | 345 //! |
276 //! @par Throws | 346 //! @par Throws |
277 //! @li If \c boost::has_nothrow_move<Value>::value is \c true and Value's move constructor throws. | 347 //! @li If \c has_nothrow_move<Value>::value is \c true and Value's move constructor or move assignment throws. |
278 //! @li If \c boost::has_nothrow_move<Value>::value is \c false and Value's copy constructor throws. | 348 //! @li If \c has_nothrow_move<Value>::value is \c false and Value's copy constructor or copy assignment throws. |
279 //! | |
280 //! @par Complexity | |
281 //! Linear O(N). | |
282 static_vector(BOOST_RV_REF(static_vector) other) | |
283 : base_t(boost::move(static_cast<base_t&>(other))) | |
284 {} | |
285 | |
286 //! @pre <tt>other.size() <= capacity()</tt> | |
287 //! | |
288 //! @brief Move constructor. Moves Values stored in the other static_vector to this one. | |
289 //! | |
290 //! @param other The static_vector which content will be moved to this one. | |
291 //! | |
292 //! @par Throws | |
293 //! @li If \c boost::has_nothrow_move<Value>::value is \c true and Value's move constructor throws. | |
294 //! @li If \c boost::has_nothrow_move<Value>::value is \c false and Value's copy constructor throws. | |
295 //! | |
296 //! @par Complexity | |
297 //! Linear O(N). | |
298 template <std::size_t C> | |
299 static_vector(BOOST_RV_REF_BEG static_vector<value_type, C> BOOST_RV_REF_END other) | |
300 : base_t(boost::move(static_cast<typename static_vector<value_type, C>::base_t&>(other))) | |
301 {} | |
302 | |
303 //! @brief Move assignment. Moves Values stored in the other static_vector to this one. | |
304 //! | |
305 //! @param other The static_vector which content will be moved to this one. | |
306 //! | |
307 //! @par Throws | |
308 //! @li If \c boost::has_nothrow_move<Value>::value is \c true and Value's move constructor or move assignment throws. | |
309 //! @li If \c boost::has_nothrow_move<Value>::value is \c false and Value's copy constructor or copy assignment throws. | |
310 //! | 349 //! |
311 //! @par Complexity | 350 //! @par Complexity |
312 //! Linear O(N). | 351 //! Linear O(N). |
313 static_vector & operator=(BOOST_RV_REF(static_vector) other) | 352 static_vector & operator=(BOOST_RV_REF(static_vector) other) |
314 { | 353 { |
315 base_t::operator=(boost::move(static_cast<base_t&>(other))); | 354 return static_cast<static_vector&>(base_t::operator=(BOOST_MOVE_BASE(base_t, other))); |
316 return *this; | |
317 } | 355 } |
318 | 356 |
319 //! @pre <tt>other.size() <= capacity()</tt> | 357 //! @pre <tt>other.size() <= capacity()</tt> |
320 //! | 358 //! |
321 //! @brief Move assignment. Moves Values stored in the other static_vector to this one. | 359 //! @brief Move assignment. Moves Values stored in the other static_vector to this one. |
322 //! | 360 //! |
323 //! @param other The static_vector which content will be moved to this one. | 361 //! @param other The static_vector which content will be moved to this one. |
324 //! | 362 //! |
325 //! @par Throws | 363 //! @par Throws |
326 //! @li If \c boost::has_nothrow_move<Value>::value is \c true and Value's move constructor or move assignment throws. | 364 //! @li If \c has_nothrow_move<Value>::value is \c true and Value's move constructor or move assignment throws. |
327 //! @li If \c boost::has_nothrow_move<Value>::value is \c false and Value's copy constructor or copy assignment throws. | 365 //! @li If \c has_nothrow_move<Value>::value is \c false and Value's copy constructor or copy assignment throws. |
328 //! | 366 //! |
329 //! @par Complexity | 367 //! @par Complexity |
330 //! Linear O(N). | 368 //! Linear O(N). |
331 template <std::size_t C> | 369 template <std::size_t C> |
332 static_vector & operator=(BOOST_RV_REF_BEG static_vector<value_type, C> BOOST_RV_REF_END other) | 370 static_vector & operator=(BOOST_RV_REF_BEG static_vector<value_type, C> BOOST_RV_REF_END other) |
333 { | 371 { |
334 base_t::operator=(boost::move(static_cast<typename static_vector<value_type, C>::base_t&>(other))); | 372 return static_cast<static_vector&>(base_t::operator= |
335 return *this; | 373 (BOOST_MOVE_BASE(typename static_vector<value_type BOOST_MOVE_I C>::base_t, other))); |
336 } | 374 } |
337 | 375 |
338 #ifdef BOOST_CONTAINER_DOXYGEN_INVOKED | 376 #ifdef BOOST_CONTAINER_DOXYGEN_INVOKED |
339 | 377 |
340 //! @brief Destructor. Destroys Values stored in this container. | 378 //! @brief Destructor. Destroys Values stored in this container. |
349 //! @brief Swaps contents of the other static_vector and this one. | 387 //! @brief Swaps contents of the other static_vector and this one. |
350 //! | 388 //! |
351 //! @param other The static_vector which content will be swapped with this one's content. | 389 //! @param other The static_vector which content will be swapped with this one's content. |
352 //! | 390 //! |
353 //! @par Throws | 391 //! @par Throws |
354 //! @li If \c boost::has_nothrow_move<Value>::value is \c true and Value's move constructor or move assignment throws, | 392 //! @li If \c has_nothrow_move<Value>::value is \c true and Value's move constructor or move assignment throws, |
355 //! @li If \c boost::has_nothrow_move<Value>::value is \c false and Value's copy constructor or copy assignment throws, | 393 //! @li If \c has_nothrow_move<Value>::value is \c false and Value's copy constructor or copy assignment throws, |
356 //! | 394 //! |
357 //! @par Complexity | 395 //! @par Complexity |
358 //! Linear O(N). | 396 //! Linear O(N). |
359 void swap(static_vector & other); | 397 void swap(static_vector & other); |
360 | 398 |
363 //! @brief Swaps contents of the other static_vector and this one. | 401 //! @brief Swaps contents of the other static_vector and this one. |
364 //! | 402 //! |
365 //! @param other The static_vector which content will be swapped with this one's content. | 403 //! @param other The static_vector which content will be swapped with this one's content. |
366 //! | 404 //! |
367 //! @par Throws | 405 //! @par Throws |
368 //! @li If \c boost::has_nothrow_move<Value>::value is \c true and Value's move constructor or move assignment throws, | 406 //! @li If \c has_nothrow_move<Value>::value is \c true and Value's move constructor or move assignment throws, |
369 //! @li If \c boost::has_nothrow_move<Value>::value is \c false and Value's copy constructor or copy assignment throws, | 407 //! @li If \c has_nothrow_move<Value>::value is \c false and Value's copy constructor or copy assignment throws, |
370 //! | 408 //! |
371 //! @par Complexity | 409 //! @par Complexity |
372 //! Linear O(N). | 410 //! Linear O(N). |
373 template <std::size_t C> | 411 template <std::size_t C> |
374 void swap(static_vector<value_type, C> & other); | 412 void swap(static_vector<value_type, C> & other); |
379 //! the size becomes count. New elements are value initialized. | 417 //! the size becomes count. New elements are value initialized. |
380 //! | 418 //! |
381 //! @param count The number of elements which will be stored in the container. | 419 //! @param count The number of elements which will be stored in the container. |
382 //! | 420 //! |
383 //! @par Throws | 421 //! @par Throws |
384 //! If Value's default constructor throws. | 422 //! If Value's value initialization throws. |
385 //! | 423 //! |
386 //! @par Complexity | 424 //! @par Complexity |
387 //! Linear O(N). | 425 //! Linear O(N). |
388 void resize(size_type count); | 426 void resize(size_type count); |
389 | 427 |
393 //! the size becomes count. New elements are default initialized. | 431 //! the size becomes count. New elements are default initialized. |
394 //! | 432 //! |
395 //! @param count The number of elements which will be stored in the container. | 433 //! @param count The number of elements which will be stored in the container. |
396 //! | 434 //! |
397 //! @par Throws | 435 //! @par Throws |
398 //! If Value's default constructor throws. | 436 //! If Value's default initialization throws. |
399 //! | 437 //! |
400 //! @par Complexity | 438 //! @par Complexity |
401 //! Linear O(N). | 439 //! Linear O(N). |
402 //! | 440 //! |
403 //! @par Note | 441 //! @par Note |
428 //! @par Throws | 466 //! @par Throws |
429 //! Nothing. | 467 //! Nothing. |
430 //! | 468 //! |
431 //! @par Complexity | 469 //! @par Complexity |
432 //! Linear O(N). | 470 //! Linear O(N). |
433 void reserve(size_type count) BOOST_CONTAINER_NOEXCEPT; | 471 void reserve(size_type count) BOOST_NOEXCEPT_OR_NOTHROW; |
434 | 472 |
435 //! @pre <tt>size() < capacity()</tt> | 473 //! @pre <tt>size() < capacity()</tt> |
436 //! | 474 //! |
437 //! @brief Adds a copy of value at the end. | 475 //! @brief Adds a copy of value at the end. |
438 //! | 476 //! |
468 //! @par Complexity | 506 //! @par Complexity |
469 //! Constant O(1). | 507 //! Constant O(1). |
470 void pop_back(); | 508 void pop_back(); |
471 | 509 |
472 //! @pre | 510 //! @pre |
473 //! @li \c position must be a valid iterator of \c *this in range <tt>[begin(), end()]</tt>. | 511 //! @li \c p must be a valid iterator of \c *this in range <tt>[begin(), end()]</tt>. |
474 //! @li <tt>size() < capacity()</tt> | 512 //! @li <tt>size() < capacity()</tt> |
475 //! | 513 //! |
476 //! @brief Inserts a copy of element at position. | 514 //! @brief Inserts a copy of element at p. |
477 //! | 515 //! |
478 //! @param position The position at which the new value will be inserted. | 516 //! @param p The position at which the new value will be inserted. |
479 //! @param value The value used to copy construct the new element. | 517 //! @param value The value used to copy construct the new element. |
480 //! | 518 //! |
481 //! @par Throws | 519 //! @par Throws |
482 //! @li If Value's copy constructor or copy assignment throws | 520 //! @li If Value's copy constructor or copy assignment throws |
483 //! @li If Value's move constructor or move assignment throws. | 521 //! @li If Value's move constructor or move assignment throws. |
484 //! | 522 //! |
485 //! @par Complexity | 523 //! @par Complexity |
486 //! Constant or linear. | 524 //! Constant or linear. |
487 iterator insert(iterator position, value_type const& value); | 525 iterator insert(const_iterator p, value_type const& value); |
488 | 526 |
489 //! @pre | 527 //! @pre |
490 //! @li \c position must be a valid iterator of \c *this in range <tt>[begin(), end()]</tt>. | 528 //! @li \c p must be a valid iterator of \c *this in range <tt>[begin(), end()]</tt>. |
491 //! @li <tt>size() < capacity()</tt> | 529 //! @li <tt>size() < capacity()</tt> |
492 //! | 530 //! |
493 //! @brief Inserts a move-constructed element at position. | 531 //! @brief Inserts a move-constructed element at p. |
494 //! | 532 //! |
495 //! @param position The position at which the new value will be inserted. | 533 //! @param p The position at which the new value will be inserted. |
496 //! @param value The value used to move construct the new element. | 534 //! @param value The value used to move construct the new element. |
497 //! | 535 //! |
498 //! @par Throws | 536 //! @par Throws |
499 //! If Value's move constructor or move assignment throws. | 537 //! If Value's move constructor or move assignment throws. |
500 //! | 538 //! |
501 //! @par Complexity | 539 //! @par Complexity |
502 //! Constant or linear. | 540 //! Constant or linear. |
503 iterator insert(iterator position, BOOST_RV_REF(value_type) value); | 541 iterator insert(const_iterator p, BOOST_RV_REF(value_type) value); |
504 | 542 |
505 //! @pre | 543 //! @pre |
506 //! @li \c position must be a valid iterator of \c *this in range <tt>[begin(), end()]</tt>. | 544 //! @li \c p must be a valid iterator of \c *this in range <tt>[begin(), end()]</tt>. |
507 //! @li <tt>size() + count <= capacity()</tt> | 545 //! @li <tt>size() + count <= capacity()</tt> |
508 //! | 546 //! |
509 //! @brief Inserts a count copies of value at position. | 547 //! @brief Inserts a count copies of value at p. |
510 //! | 548 //! |
511 //! @param position The position at which new elements will be inserted. | 549 //! @param p The position at which new elements will be inserted. |
512 //! @param count The number of new elements which will be inserted. | 550 //! @param count The number of new elements which will be inserted. |
513 //! @param value The value used to copy construct new elements. | 551 //! @param value The value used to copy construct new elements. |
514 //! | 552 //! |
515 //! @par Throws | 553 //! @par Throws |
516 //! @li If Value's copy constructor or copy assignment throws. | 554 //! @li If Value's copy constructor or copy assignment throws. |
517 //! @li If Value's move constructor or move assignment throws. | 555 //! @li If Value's move constructor or move assignment throws. |
518 //! | 556 //! |
519 //! @par Complexity | 557 //! @par Complexity |
520 //! Linear O(N). | 558 //! Linear O(N). |
521 iterator insert(iterator position, size_type count, value_type const& value); | 559 iterator insert(const_iterator p, size_type count, value_type const& value); |
522 | 560 |
523 //! @pre | 561 //! @pre |
524 //! @li \c position must be a valid iterator of \c *this in range <tt>[begin(), end()]</tt>. | 562 //! @li \c p must be a valid iterator of \c *this in range <tt>[begin(), end()]</tt>. |
525 //! @li <tt>distance(first, last) <= capacity()</tt> | 563 //! @li <tt>distance(first, last) <= capacity()</tt> |
526 //! @li \c Iterator must meet the \c ForwardTraversalIterator concept. | 564 //! @li \c Iterator must meet the \c ForwardTraversalIterator concept. |
527 //! | 565 //! |
528 //! @brief Inserts a copy of a range <tt>[first, last)</tt> at position. | 566 //! @brief Inserts a copy of a range <tt>[first, last)</tt> at p. |
529 //! | 567 //! |
530 //! @param position The position at which new elements will be inserted. | 568 //! @param p The position at which new elements will be inserted. |
531 //! @param first The iterator to the first element of a range used to construct new elements. | 569 //! @param first The iterator to the first element of a range used to construct new elements. |
532 //! @param last The iterator to the one after the last element of a range used to construct new elements. | 570 //! @param last The iterator to the one after the last element of a range used to construct new elements. |
533 //! | 571 //! |
534 //! @par Throws | 572 //! @par Throws |
535 //! @li If Value's constructor and assignment taking a dereferenced \c Iterator. | 573 //! @li If Value's constructor and assignment taking a dereferenced \c Iterator. |
536 //! @li If Value's move constructor or move assignment throws. | 574 //! @li If Value's move constructor or move assignment throws. |
537 //! | 575 //! |
538 //! @par Complexity | 576 //! @par Complexity |
539 //! Linear O(N). | 577 //! Linear O(N). |
540 template <typename Iterator> | 578 template <typename Iterator> |
541 iterator insert(iterator position, Iterator first, Iterator last); | 579 iterator insert(const_iterator p, Iterator first, Iterator last); |
542 | 580 |
543 //! @pre \c position must be a valid iterator of \c *this in range <tt>[begin(), end())</tt> | 581 #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) |
544 //! | 582 //! @pre |
545 //! @brief Erases Value from position. | 583 //! @li \c p must be a valid iterator of \c *this in range <tt>[begin(), end()]</tt>. |
546 //! | 584 //! @li <tt>distance(il.begin(), il.end()) <= capacity()</tt> |
547 //! @param position The position of the element which will be erased from the container. | 585 //! |
586 //! @brief Inserts a copy of a range <tt>[il.begin(), il.end())</tt> at p. | |
587 //! | |
588 //! @param p The position at which new elements will be inserted. | |
589 //! @param il The std::initializer_list which contains elements that will be inserted. | |
590 //! | |
591 //! @par Throws | |
592 //! @li If Value's constructor and assignment taking a dereferenced std::initializer_list iterator. | |
593 //! | |
594 //! @par Complexity | |
595 //! Linear O(N). | |
596 iterator insert(const_iterator p, std::initializer_list<value_type> il); | |
597 #endif | |
598 | |
599 //! @pre \c p must be a valid iterator of \c *this in range <tt>[begin(), end())</tt> | |
600 //! | |
601 //! @brief Erases Value from p. | |
602 //! | |
603 //! @param p The position of the element which will be erased from the container. | |
548 //! | 604 //! |
549 //! @par Throws | 605 //! @par Throws |
550 //! If Value's move assignment throws. | 606 //! If Value's move assignment throws. |
551 //! | 607 //! |
552 //! @par Complexity | 608 //! @par Complexity |
553 //! Linear O(N). | 609 //! Linear O(N). |
554 iterator erase(iterator position); | 610 iterator erase(const_iterator p); |
555 | 611 |
556 //! @pre | 612 //! @pre |
557 //! @li \c first and \c last must define a valid range | 613 //! @li \c first and \c last must define a valid range |
558 //! @li iterators must be in range <tt>[begin(), end()]</tt> | 614 //! @li iterators must be in range <tt>[begin(), end()]</tt> |
559 //! | 615 //! |
565 //! @par Throws | 621 //! @par Throws |
566 //! If Value's move assignment throws. | 622 //! If Value's move assignment throws. |
567 //! | 623 //! |
568 //! @par Complexity | 624 //! @par Complexity |
569 //! Linear O(N). | 625 //! Linear O(N). |
570 iterator erase(iterator first, iterator last); | 626 iterator erase(const_iterator first, const_iterator last); |
571 | 627 |
572 //! @pre <tt>distance(first, last) <= capacity()</tt> | 628 //! @pre <tt>distance(first, last) <= capacity()</tt> |
573 //! | 629 //! |
574 //! @brief Assigns a range <tt>[first, last)</tt> of Values to this container. | 630 //! @brief Assigns a range <tt>[first, last)</tt> of Values to this container. |
575 //! | 631 //! |
582 //! @par Complexity | 638 //! @par Complexity |
583 //! Linear O(N). | 639 //! Linear O(N). |
584 template <typename Iterator> | 640 template <typename Iterator> |
585 void assign(Iterator first, Iterator last); | 641 void assign(Iterator first, Iterator last); |
586 | 642 |
643 #if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) | |
644 //! @pre <tt>distance(il.begin(), il.end()) <= capacity()</tt> | |
645 //! | |
646 //! @brief Assigns a range <tt>[il.begin(), il.end())</tt> of Values to this container. | |
647 //! | |
648 //! @param first std::initializer_list with values used to construct new content of this container. | |
649 //! | |
650 //! @par Throws | |
651 //! If Value's copy constructor or copy assignment throws, | |
652 //! | |
653 //! @par Complexity | |
654 //! Linear O(N). | |
655 void assign(std::initializer_list<value_type> il); | |
656 #endif | |
657 | |
587 //! @pre <tt>count <= capacity()</tt> | 658 //! @pre <tt>count <= capacity()</tt> |
588 //! | 659 //! |
589 //! @brief Assigns a count copies of value to this container. | 660 //! @brief Assigns a count copies of value to this container. |
590 //! | 661 //! |
591 //! @param count The new number of elements which will be container in the container. | 662 //! @param count The new number of elements which will be container in the container. |
612 //! Constant O(1). | 683 //! Constant O(1). |
613 template<class ...Args> | 684 template<class ...Args> |
614 void emplace_back(Args &&...args); | 685 void emplace_back(Args &&...args); |
615 | 686 |
616 //! @pre | 687 //! @pre |
617 //! @li \c position must be a valid iterator of \c *this in range <tt>[begin(), end()]</tt> | 688 //! @li \c p must be a valid iterator of \c *this in range <tt>[begin(), end()]</tt> |
618 //! @li <tt>size() < capacity()</tt> | 689 //! @li <tt>size() < capacity()</tt> |
619 //! | 690 //! |
620 //! @brief Inserts a Value constructed with | 691 //! @brief Inserts a Value constructed with |
621 //! \c std::forward<Args>(args)... before position | 692 //! \c std::forward<Args>(args)... before p |
622 //! | 693 //! |
623 //! @param position The position at which new elements will be inserted. | 694 //! @param p The position at which new elements will be inserted. |
624 //! @param args The arguments of the constructor of the new element. | 695 //! @param args The arguments of the constructor of the new element. |
625 //! | 696 //! |
626 //! @par Throws | 697 //! @par Throws |
627 //! If in-place constructor throws or if Value's move constructor or move assignment throws. | 698 //! If in-place constructor throws or if Value's move constructor or move assignment throws. |
628 //! | 699 //! |
629 //! @par Complexity | 700 //! @par Complexity |
630 //! Constant or linear. | 701 //! Constant or linear. |
631 template<class ...Args> | 702 template<class ...Args> |
632 iterator emplace(iterator position, Args &&...args); | 703 iterator emplace(const_iterator p, Args &&...args); |
633 | 704 |
634 //! @brief Removes all elements from the container. | 705 //! @brief Removes all elements from the container. |
635 //! | 706 //! |
636 //! @par Throws | 707 //! @par Throws |
637 //! Nothing. | 708 //! Nothing. |
638 //! | 709 //! |
639 //! @par Complexity | 710 //! @par Complexity |
640 //! Constant O(1). | 711 //! Constant O(1). |
641 void clear() BOOST_CONTAINER_NOEXCEPT; | 712 void clear() BOOST_NOEXCEPT_OR_NOTHROW; |
642 | 713 |
643 //! @pre <tt>i < size()</tt> | 714 //! @pre <tt>i < size()</tt> |
644 //! | 715 //! |
645 //! @brief Returns reference to the i-th element. | 716 //! @brief Returns reference to the i-th element. |
646 //! | 717 //! |
702 //! | 773 //! |
703 //! @par Complexity | 774 //! @par Complexity |
704 //! Constant O(1). | 775 //! Constant O(1). |
705 const_reference operator[](size_type i) const; | 776 const_reference operator[](size_type i) const; |
706 | 777 |
778 //! @pre <tt>i =< size()</tt> | |
779 //! | |
780 //! @brief Returns a iterator to the i-th element. | |
781 //! | |
782 //! @param i The element's index. | |
783 //! | |
784 //! @return a iterator to the i-th element. | |
785 //! | |
786 //! @par Throws | |
787 //! Nothing by default. | |
788 //! | |
789 //! @par Complexity | |
790 //! Constant O(1). | |
791 iterator nth(size_type i); | |
792 | |
793 //! @pre <tt>i =< size()</tt> | |
794 //! | |
795 //! @brief Returns a const_iterator to the i-th element. | |
796 //! | |
797 //! @param i The element's index. | |
798 //! | |
799 //! @return a const_iterator to the i-th element. | |
800 //! | |
801 //! @par Throws | |
802 //! Nothing by default. | |
803 //! | |
804 //! @par Complexity | |
805 //! Constant O(1). | |
806 const_iterator nth(size_type i) const; | |
807 | |
808 //! @pre <tt>begin() <= p <= end()</tt> | |
809 //! | |
810 //! @brief Returns the index of the element pointed by p. | |
811 //! | |
812 //! @param i The element's index. | |
813 //! | |
814 //! @return The index of the element pointed by p. | |
815 //! | |
816 //! @par Throws | |
817 //! Nothing by default. | |
818 //! | |
819 //! @par Complexity | |
820 //! Constant O(1). | |
821 size_type index_of(iterator p); | |
822 | |
823 //! @pre <tt>begin() <= p <= end()</tt> | |
824 //! | |
825 //! @brief Returns the index of the element pointed by p. | |
826 //! | |
827 //! @param i The index of the element pointed by p. | |
828 //! | |
829 //! @return a const_iterator to the i-th element. | |
830 //! | |
831 //! @par Throws | |
832 //! Nothing by default. | |
833 //! | |
834 //! @par Complexity | |
835 //! Constant O(1). | |
836 size_type index_of(const_iterator p) const; | |
837 | |
707 //! @pre \c !empty() | 838 //! @pre \c !empty() |
708 //! | 839 //! |
709 //! @brief Returns reference to the first element. | 840 //! @brief Returns reference to the first element. |
710 //! | 841 //! |
711 //! @return reference to the first element | 842 //! @return reference to the first element |
766 //! @par Throws | 897 //! @par Throws |
767 //! Nothing. | 898 //! Nothing. |
768 //! | 899 //! |
769 //! @par Complexity | 900 //! @par Complexity |
770 //! Constant O(1). | 901 //! Constant O(1). |
771 Value * data() BOOST_CONTAINER_NOEXCEPT; | 902 Value * data() BOOST_NOEXCEPT_OR_NOTHROW; |
772 | 903 |
773 //! @brief Const pointer such that <tt>[data(), data() + size())</tt> is a valid range. | 904 //! @brief Const pointer such that <tt>[data(), data() + size())</tt> is a valid range. |
774 //! For a non-empty vector <tt>data() == &front()</tt>. | 905 //! For a non-empty vector <tt>data() == &front()</tt>. |
775 //! | 906 //! |
776 //! @par Throws | 907 //! @par Throws |
777 //! Nothing. | 908 //! Nothing. |
778 //! | 909 //! |
779 //! @par Complexity | 910 //! @par Complexity |
780 //! Constant O(1). | 911 //! Constant O(1). |
781 const Value * data() const BOOST_CONTAINER_NOEXCEPT; | 912 const Value * data() const BOOST_NOEXCEPT_OR_NOTHROW; |
782 | 913 |
783 //! @brief Returns iterator to the first element. | 914 //! @brief Returns iterator to the first element. |
784 //! | 915 //! |
785 //! @return iterator to the first element contained in the vector. | 916 //! @return iterator to the first element contained in the vector. |
786 //! | 917 //! |
787 //! @par Throws | 918 //! @par Throws |
788 //! Nothing. | 919 //! Nothing. |
789 //! | 920 //! |
790 //! @par Complexity | 921 //! @par Complexity |
791 //! Constant O(1). | 922 //! Constant O(1). |
792 iterator begin() BOOST_CONTAINER_NOEXCEPT; | 923 iterator begin() BOOST_NOEXCEPT_OR_NOTHROW; |
793 | 924 |
794 //! @brief Returns const iterator to the first element. | 925 //! @brief Returns const iterator to the first element. |
795 //! | 926 //! |
796 //! @return const_iterator to the first element contained in the vector. | 927 //! @return const_iterator to the first element contained in the vector. |
797 //! | 928 //! |
798 //! @par Throws | 929 //! @par Throws |
799 //! Nothing. | 930 //! Nothing. |
800 //! | 931 //! |
801 //! @par Complexity | 932 //! @par Complexity |
802 //! Constant O(1). | 933 //! Constant O(1). |
803 const_iterator begin() const BOOST_CONTAINER_NOEXCEPT; | 934 const_iterator begin() const BOOST_NOEXCEPT_OR_NOTHROW; |
804 | 935 |
805 //! @brief Returns const iterator to the first element. | 936 //! @brief Returns const iterator to the first element. |
806 //! | 937 //! |
807 //! @return const_iterator to the first element contained in the vector. | 938 //! @return const_iterator to the first element contained in the vector. |
808 //! | 939 //! |
809 //! @par Throws | 940 //! @par Throws |
810 //! Nothing. | 941 //! Nothing. |
811 //! | 942 //! |
812 //! @par Complexity | 943 //! @par Complexity |
813 //! Constant O(1). | 944 //! Constant O(1). |
814 const_iterator cbegin() const BOOST_CONTAINER_NOEXCEPT; | 945 const_iterator cbegin() const BOOST_NOEXCEPT_OR_NOTHROW; |
815 | 946 |
816 //! @brief Returns iterator to the one after the last element. | 947 //! @brief Returns iterator to the one after the last element. |
817 //! | 948 //! |
818 //! @return iterator pointing to the one after the last element contained in the vector. | 949 //! @return iterator pointing to the one after the last element contained in the vector. |
819 //! | 950 //! |
820 //! @par Throws | 951 //! @par Throws |
821 //! Nothing. | 952 //! Nothing. |
822 //! | 953 //! |
823 //! @par Complexity | 954 //! @par Complexity |
824 //! Constant O(1). | 955 //! Constant O(1). |
825 iterator end() BOOST_CONTAINER_NOEXCEPT; | 956 iterator end() BOOST_NOEXCEPT_OR_NOTHROW; |
826 | 957 |
827 //! @brief Returns const iterator to the one after the last element. | 958 //! @brief Returns const iterator to the one after the last element. |
828 //! | 959 //! |
829 //! @return const_iterator pointing to the one after the last element contained in the vector. | 960 //! @return const_iterator pointing to the one after the last element contained in the vector. |
830 //! | 961 //! |
831 //! @par Throws | 962 //! @par Throws |
832 //! Nothing. | 963 //! Nothing. |
833 //! | 964 //! |
834 //! @par Complexity | 965 //! @par Complexity |
835 //! Constant O(1). | 966 //! Constant O(1). |
836 const_iterator end() const BOOST_CONTAINER_NOEXCEPT; | 967 const_iterator end() const BOOST_NOEXCEPT_OR_NOTHROW; |
837 | 968 |
838 //! @brief Returns const iterator to the one after the last element. | 969 //! @brief Returns const iterator to the one after the last element. |
839 //! | 970 //! |
840 //! @return const_iterator pointing to the one after the last element contained in the vector. | 971 //! @return const_iterator pointing to the one after the last element contained in the vector. |
841 //! | 972 //! |
842 //! @par Throws | 973 //! @par Throws |
843 //! Nothing. | 974 //! Nothing. |
844 //! | 975 //! |
845 //! @par Complexity | 976 //! @par Complexity |
846 //! Constant O(1). | 977 //! Constant O(1). |
847 const_iterator cend() const BOOST_CONTAINER_NOEXCEPT; | 978 const_iterator cend() const BOOST_NOEXCEPT_OR_NOTHROW; |
848 | 979 |
849 //! @brief Returns reverse iterator to the first element of the reversed container. | 980 //! @brief Returns reverse iterator to the first element of the reversed container. |
850 //! | 981 //! |
851 //! @return reverse_iterator pointing to the beginning | 982 //! @return reverse_iterator pointing to the beginning |
852 //! of the reversed static_vector. | 983 //! of the reversed static_vector. |
854 //! @par Throws | 985 //! @par Throws |
855 //! Nothing. | 986 //! Nothing. |
856 //! | 987 //! |
857 //! @par Complexity | 988 //! @par Complexity |
858 //! Constant O(1). | 989 //! Constant O(1). |
859 reverse_iterator rbegin() BOOST_CONTAINER_NOEXCEPT; | 990 reverse_iterator rbegin() BOOST_NOEXCEPT_OR_NOTHROW; |
860 | 991 |
861 //! @brief Returns const reverse iterator to the first element of the reversed container. | 992 //! @brief Returns const reverse iterator to the first element of the reversed container. |
862 //! | 993 //! |
863 //! @return const_reverse_iterator pointing to the beginning | 994 //! @return const_reverse_iterator pointing to the beginning |
864 //! of the reversed static_vector. | 995 //! of the reversed static_vector. |
866 //! @par Throws | 997 //! @par Throws |
867 //! Nothing. | 998 //! Nothing. |
868 //! | 999 //! |
869 //! @par Complexity | 1000 //! @par Complexity |
870 //! Constant O(1). | 1001 //! Constant O(1). |
871 const_reverse_iterator rbegin() const BOOST_CONTAINER_NOEXCEPT; | 1002 const_reverse_iterator rbegin() const BOOST_NOEXCEPT_OR_NOTHROW; |
872 | 1003 |
873 //! @brief Returns const reverse iterator to the first element of the reversed container. | 1004 //! @brief Returns const reverse iterator to the first element of the reversed container. |
874 //! | 1005 //! |
875 //! @return const_reverse_iterator pointing to the beginning | 1006 //! @return const_reverse_iterator pointing to the beginning |
876 //! of the reversed static_vector. | 1007 //! of the reversed static_vector. |
878 //! @par Throws | 1009 //! @par Throws |
879 //! Nothing. | 1010 //! Nothing. |
880 //! | 1011 //! |
881 //! @par Complexity | 1012 //! @par Complexity |
882 //! Constant O(1). | 1013 //! Constant O(1). |
883 const_reverse_iterator crbegin() const BOOST_CONTAINER_NOEXCEPT; | 1014 const_reverse_iterator crbegin() const BOOST_NOEXCEPT_OR_NOTHROW; |
884 | 1015 |
885 //! @brief Returns reverse iterator to the one after the last element of the reversed container. | 1016 //! @brief Returns reverse iterator to the one after the last element of the reversed container. |
886 //! | 1017 //! |
887 //! @return reverse_iterator pointing to the one after the last element | 1018 //! @return reverse_iterator pointing to the one after the last element |
888 //! of the reversed static_vector. | 1019 //! of the reversed static_vector. |
890 //! @par Throws | 1021 //! @par Throws |
891 //! Nothing. | 1022 //! Nothing. |
892 //! | 1023 //! |
893 //! @par Complexity | 1024 //! @par Complexity |
894 //! Constant O(1). | 1025 //! Constant O(1). |
895 reverse_iterator rend() BOOST_CONTAINER_NOEXCEPT; | 1026 reverse_iterator rend() BOOST_NOEXCEPT_OR_NOTHROW; |
896 | 1027 |
897 //! @brief Returns const reverse iterator to the one after the last element of the reversed container. | 1028 //! @brief Returns const reverse iterator to the one after the last element of the reversed container. |
898 //! | 1029 //! |
899 //! @return const_reverse_iterator pointing to the one after the last element | 1030 //! @return const_reverse_iterator pointing to the one after the last element |
900 //! of the reversed static_vector. | 1031 //! of the reversed static_vector. |
902 //! @par Throws | 1033 //! @par Throws |
903 //! Nothing. | 1034 //! Nothing. |
904 //! | 1035 //! |
905 //! @par Complexity | 1036 //! @par Complexity |
906 //! Constant O(1). | 1037 //! Constant O(1). |
907 const_reverse_iterator rend() const BOOST_CONTAINER_NOEXCEPT; | 1038 const_reverse_iterator rend() const BOOST_NOEXCEPT_OR_NOTHROW; |
908 | 1039 |
909 //! @brief Returns const reverse iterator to the one after the last element of the reversed container. | 1040 //! @brief Returns const reverse iterator to the one after the last element of the reversed container. |
910 //! | 1041 //! |
911 //! @return const_reverse_iterator pointing to the one after the last element | 1042 //! @return const_reverse_iterator pointing to the one after the last element |
912 //! of the reversed static_vector. | 1043 //! of the reversed static_vector. |
914 //! @par Throws | 1045 //! @par Throws |
915 //! Nothing. | 1046 //! Nothing. |
916 //! | 1047 //! |
917 //! @par Complexity | 1048 //! @par Complexity |
918 //! Constant O(1). | 1049 //! Constant O(1). |
919 const_reverse_iterator crend() const BOOST_CONTAINER_NOEXCEPT; | 1050 const_reverse_iterator crend() const BOOST_NOEXCEPT_OR_NOTHROW; |
920 | 1051 |
921 //! @brief Returns container's capacity. | 1052 //! @brief Returns container's capacity. |
922 //! | 1053 //! |
923 //! @return container's capacity. | 1054 //! @return container's capacity. |
924 //! | 1055 //! |
925 //! @par Throws | 1056 //! @par Throws |
926 //! Nothing. | 1057 //! Nothing. |
927 //! | 1058 //! |
928 //! @par Complexity | 1059 //! @par Complexity |
929 //! Constant O(1). | 1060 //! Constant O(1). |
930 static size_type capacity() BOOST_CONTAINER_NOEXCEPT; | 1061 static size_type capacity() BOOST_NOEXCEPT_OR_NOTHROW; |
931 | 1062 |
932 //! @brief Returns container's capacity. | 1063 //! @brief Returns container's capacity. |
933 //! | 1064 //! |
934 //! @return container's capacity. | 1065 //! @return container's capacity. |
935 //! | 1066 //! |
936 //! @par Throws | 1067 //! @par Throws |
937 //! Nothing. | 1068 //! Nothing. |
938 //! | 1069 //! |
939 //! @par Complexity | 1070 //! @par Complexity |
940 //! Constant O(1). | 1071 //! Constant O(1). |
941 static size_type max_size() BOOST_CONTAINER_NOEXCEPT; | 1072 static size_type max_size() BOOST_NOEXCEPT_OR_NOTHROW; |
942 | 1073 |
943 //! @brief Returns the number of stored elements. | 1074 //! @brief Returns the number of stored elements. |
944 //! | 1075 //! |
945 //! @return Number of elements contained in the container. | 1076 //! @return Number of elements contained in the container. |
946 //! | 1077 //! |
947 //! @par Throws | 1078 //! @par Throws |
948 //! Nothing. | 1079 //! Nothing. |
949 //! | 1080 //! |
950 //! @par Complexity | 1081 //! @par Complexity |
951 //! Constant O(1). | 1082 //! Constant O(1). |
952 size_type size() const BOOST_CONTAINER_NOEXCEPT; | 1083 size_type size() const BOOST_NOEXCEPT_OR_NOTHROW; |
953 | 1084 |
954 //! @brief Queries if the container contains elements. | 1085 //! @brief Queries if the container contains elements. |
955 //! | 1086 //! |
956 //! @return true if the number of elements contained in the | 1087 //! @return true if the number of elements contained in the |
957 //! container is equal to 0. | 1088 //! container is equal to 0. |
959 //! @par Throws | 1090 //! @par Throws |
960 //! Nothing. | 1091 //! Nothing. |
961 //! | 1092 //! |
962 //! @par Complexity | 1093 //! @par Complexity |
963 //! Constant O(1). | 1094 //! Constant O(1). |
964 bool empty() const BOOST_CONTAINER_NOEXCEPT; | 1095 bool empty() const BOOST_NOEXCEPT_OR_NOTHROW; |
965 #else | 1096 #else |
966 | 1097 |
967 friend void swap(static_vector &x, static_vector &y) | 1098 friend void swap(static_vector &x, static_vector &y) |
968 { | 1099 { |
969 x.swap(y); | 1100 x.swap(y); |