A vector is a sequence that supports random access to elements, constant time insertion and removal of elements at the end, and linear time insertion and removal of elements at the beginning or in the middle. More...
#include <vector.hpp>
Public Types | |
typedef T | value_type |
typedef ::boost::container::allocator_traits < Allocator >::pointer | pointer |
typedef ::boost::container::allocator_traits < Allocator >::const_pointer | const_pointer |
typedef ::boost::container::allocator_traits < Allocator >::reference | reference |
typedef ::boost::container::allocator_traits < Allocator >::const_reference | const_reference |
typedef ::boost::container::allocator_traits < Allocator >::size_type | size_type |
typedef ::boost::container::allocator_traits < Allocator >::difference_type | difference_type |
typedef Allocator | allocator_type |
typedef Allocator | stored_allocator_type |
Public Member Functions | |
typedef | BOOST_CONTAINER_IMPDEF (iterator_impl) iterator |
typedef | BOOST_CONTAINER_IMPDEF (const_iterator_impl) const _iterator |
typedef | BOOST_CONTAINER_IMPDEF (container_detail::reverse_iterator< iterator >) reverse_iterator |
typedef | BOOST_CONTAINER_IMPDEF (container_detail::reverse_iterator< const_iterator >) const _reverse_iterator |
vector () BOOST_CONTAINER_NOEXCEPT_IF( | |
Effects: Constructs a vector taking the allocator as parameter. More... | |
vector (const Allocator &a) BOOST_CONTAINER_NOEXCEPT | |
Effects: Constructs a vector taking the allocator as parameter. More... | |
vector (size_type n) | |
Effects: Constructs a vector that will use a copy of allocator a and inserts n value initialized values. More... | |
vector (size_type n, default_init_t) | |
Effects: Constructs a vector that will use a copy of allocator a and inserts n default initialized values. More... | |
vector (size_type n, const T &value) | |
Effects: Constructs a vector and inserts n copies of value. More... | |
vector (size_type n, const T &value, const allocator_type &a) | |
Effects: Constructs a vector that will use a copy of allocator a and inserts n copies of value. More... | |
template<class InIt > | |
vector (InIt first, InIt last) | |
Effects: Constructs a vector and inserts a copy of the range [first, last) in the vector. More... | |
template<class InIt > | |
vector (InIt first, InIt last, const allocator_type &a) | |
Effects: Constructs a vector that will use a copy of allocator a and inserts a copy of the range [first, last) in the vector. More... | |
vector (const vector &x) | |
Effects: Copy constructs a vector. More... | |
vector (std::initializer_list< value_type > il, const allocator_type &a=allocator_type()) | |
Effects: Constructs a vector that will use a copy of allocator a and inserts a copy of the range [il.begin(), il.last()) in the vector More... | |
vector (BOOST_RV_REF(vector) x) BOOST_CONTAINER_NOEXCEPT | |
Effects: Move constructor. More... | |
template<class OtherAllocator > | |
vector (BOOST_RV_REF_BEG vector< T, OtherAllocator > BOOST_RV_REF_END x, typename container_detail::enable_if_c< container_detail::is_version< OtherAllocator, 0 >::value >::type *=0) | |
Effects: Move constructor. More... | |
vector (const vector &x, const allocator_type &a) | |
defined(BOOST_CONTAINER_DOXYGEN_INVOKED) More... | |
vector (BOOST_RV_REF(vector) x, const allocator_type &a) | |
Effects: Move constructor using the specified allocator. More... | |
~vector () BOOST_CONTAINER_NOEXCEPT | |
Effects: Destroys the vector. More... | |
vector & | operator= (BOOST_COPY_ASSIGN_REF(vector) x) |
Effects: Makes *this contain the same elements as x. More... | |
vector & | operator= (std::initializer_list< value_type > il) |
Effects: Make *this container contains elements from il. More... | |
vector & | operator= (BOOST_RV_REF(vector) x) BOOST_CONTAINER_NOEXCEPT_IF(allocator_traits_type |
Effects: Move assignment. More... | |
template<class OtherAllocator > | |
container_detail::enable_if_c < container_detail::is_version < OtherAllocator, 0 >::value &&!container_detail::is_same < OtherAllocator, allocator_type >::value, vector & >::type | operator= (BOOST_RV_REF_BEG vector< value_type, OtherAllocator > BOOST_RV_REF_END x) |
Effects: Move assignment. More... | |
template<class OtherAllocator > | |
container_detail::enable_if_c < container_detail::is_version < OtherAllocator, 0 >::value &&!container_detail::is_same < OtherAllocator, allocator_type >::value, vector & >::type | operator= (const vector< value_type, OtherAllocator > &x) |
Effects: Copy assignment. More... | |
template<class InIt > | |
void | assign (InIt first, InIt last BOOST_CONTAINER_DOCIGN(BOOST_CONTAINER_I typename container_detail::enable_if_c< !container_detail::is_convertible< InIt BOOST_CONTAINER_I size_type >::value &&(container_detail::is_input_iterator< InIt >::value||container_detail::is_same< alloc_version BOOST_CONTAINER_I allocator_v0 >::value) >::type *=0)) |
Effects: Assigns the the range [first, last) to *this. More... | |
void | assign (std::initializer_list< T > il) |
Effects: Assigns the the range [il.begin(), il.end()) to *this. More... | |
template<class FwdIt > | |
void | assign (FwdIt first, FwdIt last BOOST_CONTAINER_DOCIGN(BOOST_CONTAINER_I typename container_detail::enable_if_c< !container_detail::is_convertible< FwdIt BOOST_CONTAINER_I size_type >::value &&(!container_detail::is_input_iterator< FwdIt >::value &&!container_detail::is_same< alloc_version BOOST_CONTAINER_I allocator_v0 >::value) >::type *=0)) |
Effects: Assigns the the range [first, last) to *this. More... | |
void | assign (size_type n, const value_type &val) |
Effects: Assigns the n copies of val to *this. More... | |
allocator_type | get_allocator () const BOOST_CONTAINER_NOEXCEPT |
Effects: Returns a copy of the internal allocator. More... | |
stored_allocator_type & | get_stored_allocator () BOOST_CONTAINER_NOEXCEPT |
Effects: Returns a reference to the internal allocator. More... | |
const stored_allocator_type & | get_stored_allocator () const BOOST_CONTAINER_NOEXCEPT |
Effects: Returns a reference to the internal allocator. More... | |
iterator | begin () BOOST_CONTAINER_NOEXCEPT |
Effects: Returns an iterator to the first element contained in the vector. More... | |
const_iterator | begin () const BOOST_CONTAINER_NOEXCEPT |
Effects: Returns a const_iterator to the first element contained in the vector. More... | |
iterator | end () BOOST_CONTAINER_NOEXCEPT |
Effects: Returns an iterator to the end of the vector. More... | |
const_iterator | end () const BOOST_CONTAINER_NOEXCEPT |
Effects: Returns a const_iterator to the end of the vector. More... | |
reverse_iterator | rbegin () BOOST_CONTAINER_NOEXCEPT |
Effects: Returns a reverse_iterator pointing to the beginning of the reversed vector. More... | |
const_reverse_iterator | rbegin () const BOOST_CONTAINER_NOEXCEPT |
Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed vector. More... | |
reverse_iterator | rend () BOOST_CONTAINER_NOEXCEPT |
Effects: Returns a reverse_iterator pointing to the end of the reversed vector. More... | |
const_reverse_iterator | rend () const BOOST_CONTAINER_NOEXCEPT |
Effects: Returns a const_reverse_iterator pointing to the end of the reversed vector. More... | |
const_iterator | cbegin () const BOOST_CONTAINER_NOEXCEPT |
Effects: Returns a const_iterator to the first element contained in the vector. More... | |
const_iterator | cend () const BOOST_CONTAINER_NOEXCEPT |
Effects: Returns a const_iterator to the end of the vector. More... | |
const_reverse_iterator | crbegin () const BOOST_CONTAINER_NOEXCEPT |
Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed vector. More... | |
const_reverse_iterator | crend () const BOOST_CONTAINER_NOEXCEPT |
Effects: Returns a const_reverse_iterator pointing to the end of the reversed vector. More... | |
bool | empty () const BOOST_CONTAINER_NOEXCEPT |
Effects: Returns true if the vector contains no elements. More... | |
size_type | size () const BOOST_CONTAINER_NOEXCEPT |
Effects: Returns the number of the elements contained in the vector. More... | |
size_type | max_size () const BOOST_CONTAINER_NOEXCEPT |
Effects: Returns the largest possible size of the vector. More... | |
void | resize (size_type new_size) |
Effects: Inserts or erases elements at the end such that the size becomes n. More... | |
void | resize (size_type new_size, default_init_t) |
Effects: Inserts or erases elements at the end such that the size becomes n. More... | |
void | resize (size_type new_size, const T &x) |
Effects: Inserts or erases elements at the end such that the size becomes n. More... | |
size_type | capacity () const BOOST_CONTAINER_NOEXCEPT |
Effects: Number of elements for which memory has been allocated. More... | |
void | reserve (size_type new_cap) |
Effects: If n is less than or equal to capacity(), this call has no effect. More... | |
void | shrink_to_fit () |
Effects: Tries to deallocate the excess of memory created with previous allocations. More... | |
reference | front () BOOST_CONTAINER_NOEXCEPT |
Requires: !empty() More... | |
const_reference | front () const BOOST_CONTAINER_NOEXCEPT |
Requires: !empty() More... | |
reference | back () BOOST_CONTAINER_NOEXCEPT |
Requires: !empty() More... | |
const_reference | back () const BOOST_CONTAINER_NOEXCEPT |
Requires: !empty() More... | |
reference | operator[] (size_type n) BOOST_CONTAINER_NOEXCEPT |
Requires: size() > n. More... | |
const_reference | operator[] (size_type n) const BOOST_CONTAINER_NOEXCEPT |
Requires: size() > n. More... | |
reference | at (size_type n) |
Requires: size() > n. More... | |
const_reference | at (size_type n) const |
Requires: size() > n. More... | |
T * | data () BOOST_CONTAINER_NOEXCEPT |
Returns: Allocator pointer such that [data(),data() + size()) is a valid range. More... | |
const T * | data () const BOOST_CONTAINER_NOEXCEPT |
Returns: Allocator pointer such that [data(),data() + size()) is a valid range. More... | |
iterator | insert (const_iterator p, size_type n, const T &x) |
Requires: p must be a valid iterator of *this. More... | |
template<class InIt > | |
iterator | insert (const_iterator pos, InIt first, InIt last BOOST_CONTAINER_DOCIGN(BOOST_CONTAINER_I typename container_detail::enable_if_c< !container_detail::is_convertible< InIt BOOST_CONTAINER_I size_type >::value &&container_detail::is_input_iterator< InIt >::value >::type *=0)) |
Requires: p must be a valid iterator of *this. More... | |
template<class FwdIt > | |
iterator | insert (const_iterator pos, FwdIt first, FwdIt last, typename container_detail::enable_if_c< !container_detail::is_convertible< FwdIt, size_type >::value &&!container_detail::is_input_iterator< FwdIt >::value >::type *=0) |
template<class InIt > | |
iterator | insert (const_iterator pos, size_type num, InIt first, InIt last) |
Requires: p must be a valid iterator of *this. More... | |
iterator | insert (const_iterator position, std::initializer_list< value_type > il) |
Requires: position must be a valid iterator of *this. More... | |
void | pop_back () BOOST_CONTAINER_NOEXCEPT |
Effects: Removes the last element from the vector. More... | |
iterator | erase (const_iterator position) |
Effects: Erases the element at position pos. More... | |
iterator | erase (const_iterator first, const_iterator last) |
Effects: Erases the elements pointed by [first, last). More... | |
void | swap (vector &x) BOOST_CONTAINER_NOEXCEPT_IF((!container_detail |
Effects: Swaps the contents of *this and x. More... | |
template<class OtherAllocator > | |
void | swap (vector< T, OtherAllocator > &x, typename container_detail::enable_if_c< container_detail::is_version< OtherAllocator, 0 >::value &&!container_detail::is_same< OtherAllocator, allocator_type >::value >::type *=0) |
Effects: Swaps the contents of *this and x. More... | |
void | clear () BOOST_CONTAINER_NOEXCEPT |
Effects: Erases all the elements of the vector. More... | |
bool | stable_reserve (size_type new_cap) |
Effects: If n is less than or equal to capacity(), this call has no effect. More... | |
template<class BiDirPosConstIt , class BiDirValueIt > | |
void | insert_ordered_at (const size_type element_count, BiDirPosConstIt last_position_it, BiDirValueIt last_value_it) |
Friends | |
template<class U , class UAllocator > | |
class | vector |
bool | operator== (const vector &x, const vector &y) |
Effects: Returns true if x and y are equal More... | |
bool | operator!= (const vector &x, const vector &y) |
Effects: Returns true if x and y are unequal More... | |
bool | operator< (const vector &x, const vector &y) |
Effects: Returns true if x is less than y More... | |
bool | operator> (const vector &x, const vector &y) |
Effects: Returns true if x is greater than y More... | |
bool | operator<= (const vector &x, const vector &y) |
Effects: Returns true if x is equal or less than y More... | |
bool | operator>= (const vector &x, const vector &y) |
Effects: Returns true if x is equal or greater than y More... | |
void | swap (vector &x, vector &y) |
Effects: x.swap(y) More... | |
A vector is a sequence that supports random access to elements, constant time insertion and removal of elements at the end, and linear time insertion and removal of elements at the beginning or in the middle.
The number of elements in a vector may vary dynamically; memory management is automatic.
T | The type of object that is stored in the vector |
Allocator | The allocator used for all internal memory management |
typedef Allocator boost::container::vector< T, BOOST_CONTAINER_DOCONLY >::allocator_type |
typedef ::boost::container::allocator_traits<Allocator>::const_pointer boost::container::vector< T, BOOST_CONTAINER_DOCONLY >::const_pointer |
typedef ::boost::container::allocator_traits<Allocator>::const_reference boost::container::vector< T, BOOST_CONTAINER_DOCONLY >::const_reference |
typedef ::boost::container::allocator_traits<Allocator>::difference_type boost::container::vector< T, BOOST_CONTAINER_DOCONLY >::difference_type |
typedef ::boost::container::allocator_traits<Allocator>::pointer boost::container::vector< T, BOOST_CONTAINER_DOCONLY >::pointer |
typedef ::boost::container::allocator_traits<Allocator>::reference boost::container::vector< T, BOOST_CONTAINER_DOCONLY >::reference |
typedef ::boost::container::allocator_traits<Allocator>::size_type boost::container::vector< T, BOOST_CONTAINER_DOCONLY >::size_type |
typedef Allocator boost::container::vector< T, BOOST_CONTAINER_DOCONLY >::stored_allocator_type |
typedef T boost::container::vector< T, BOOST_CONTAINER_DOCONLY >::value_type |
|
inline |
Effects: Constructs a vector taking the allocator as parameter.
Throws: If allocator_type's default constructor throws.
Complexity: Constant.
|
inlineexplicit |
Effects: Constructs a vector taking the allocator as parameter.
Throws: Nothing
Complexity: Constant.
|
inlineexplicit |
Effects: Constructs a vector that will use a copy of allocator a and inserts n value initialized values.
Throws: If allocator_type's default constructor or allocation throws or T's value initialization throws.
Complexity: Linear to n.
|
inline |
Effects: Constructs a vector that will use a copy of allocator a and inserts n default initialized values.
Throws: If allocator_type's default constructor or allocation throws or T's default initialization throws.
Complexity: Linear to n.
Note: Non-standard extension
|
inline |
Effects: Constructs a vector and inserts n copies of value.
Throws: If allocator_type's default constructor or allocation throws or T's copy constructor throws.
Complexity: Linear to n.
|
inline |
Effects: Constructs a vector that will use a copy of allocator a and inserts n copies of value.
Throws: If allocation throws or T's copy constructor throws.
Complexity: Linear to n.
|
inline |
Effects: Constructs a vector and inserts a copy of the range [first, last) in the vector.
Throws: If allocator_type's default constructor or allocation throws or T's constructor taking a dereferenced InIt throws.
Complexity: Linear to the range [first, last).
|
inline |
Effects: Constructs a vector that will use a copy of allocator a and inserts a copy of the range [first, last) in the vector.
Throws: If allocator_type's default constructor or allocation throws or T's constructor taking a dereferenced InIt throws.
Complexity: Linear to the range [first, last).
|
inline |
Effects: Copy constructs a vector.
Postcondition: x == *this.
Throws: If allocator_type's default constructor or allocation throws or T's copy constructor throws.
Complexity: Linear to the elements x contains.
|
inline |
Effects: Constructs a vector that will use a copy of allocator a and inserts a copy of the range [il.begin(), il.last()) in the vector
Throws: If allocator_type's default constructor throws or T's constructor taking a dereferenced initializer_list iterator throws.
Complexity: Linear to the range [il.begin(), il.end()).
|
inline |
Effects: Move constructor.
Moves x's resources to *this.
Throws: Nothing
Complexity: Constant.
|
inline |
Effects: Move constructor.
Moves x's resources to *this.
Throws: If T's move constructor or allocation throws
Complexity: Linear.
Note: Non-standard extension to support static_vector
|
inline |
defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
Effects: Copy constructs a vector using the specified allocator.
Postcondition: x == *this.
Throws: If allocation throws or T's copy constructor throws.
Complexity: Linear to the elements x contains.
|
inline |
Effects: Move constructor using the specified allocator.
Moves x's resources to *this if a == allocator_type(). Otherwise copies values from x to *this.
Throws: If allocation or T's copy constructor throws.
Complexity: Constant if a == x.get_allocator(), linear otherwise.
|
inline |
Effects: Destroys the vector.
All stored values are destroyed and used memory is deallocated.
Throws: Nothing.
Complexity: Linear to the number of elements.
|
inline |
Effects: Assigns the the range [first, last) to *this.
Throws: If memory allocation throws or T's copy/move constructor/assignment or T's constructor/assignment from dereferencing InpIt throws.
Complexity: Linear to n.
Referenced by boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::assign().
|
inline |
Effects: Assigns the the range [il.begin(), il.end()) to *this.
Throws: If memory allocation throws or T's constructor from dereferencing iniializer_list iterator throws.
|
inline |
Effects: Assigns the the range [first, last) to *this.
Throws: If memory allocation throws or T's copy/move constructor/assignment or T's constructor/assignment from dereferencing InpIt throws.
Complexity: Linear to n.
|
inline |
Effects: Assigns the n copies of val to *this.
Throws: If memory allocation throws or T's copy/move constructor/assignment throws.
Complexity: Linear to n.
|
inline |
|
inline |
|
inline |
Requires: !empty()
Effects: Returns a reference to the last element of the container.
Throws: Nothing.
Complexity: Constant.
|
inline |
Requires: !empty()
Effects: Returns a const reference to the last element of the container.
Throws: Nothing.
Complexity: Constant.
|
inline |
Effects: Returns an iterator to the first element contained in the vector.
Throws: Nothing.
Complexity: Constant.
Referenced by boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::assign(), boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::crend(), and boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::rend().
|
inline |
Effects: Returns a const_iterator to the first element contained in the vector.
Throws: Nothing.
Complexity: Constant.
typedef boost::container::vector< T, BOOST_CONTAINER_DOCONLY >::BOOST_CONTAINER_IMPDEF | ( | iterator_impl | ) |
typedef boost::container::vector< T, BOOST_CONTAINER_DOCONLY >::BOOST_CONTAINER_IMPDEF | ( | const_iterator_impl | ) | const |
typedef boost::container::vector< T, BOOST_CONTAINER_DOCONLY >::BOOST_CONTAINER_IMPDEF | ( | container_detail::reverse_iterator< iterator > | ) |
typedef boost::container::vector< T, BOOST_CONTAINER_DOCONLY >::BOOST_CONTAINER_IMPDEF | ( | container_detail::reverse_iterator< const_iterator > | ) | const |
|
inline |
Effects: Number of elements for which memory has been allocated.
capacity() is always greater than or equal to size().
Throws: Nothing.
Complexity: Constant.
Referenced by boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::assign(), and boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::reserve().
|
inline |
Effects: Returns a const_iterator to the first element contained in the vector.
Throws: Nothing.
Complexity: Constant.
Referenced by boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::insert().
|
inline |
Effects: Returns a const_iterator to the end of the vector.
Throws: Nothing.
Complexity: Constant.
Referenced by boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::assign(), boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::end(), and boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::vector().
|
inline |
Effects: Erases all the elements of the vector.
Throws: Nothing.
Complexity: Linear to the number of elements in the container.
|
inline |
Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed vector.
Throws: Nothing.
Complexity: Constant.
Referenced by boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::rbegin().
|
inline |
Effects: Returns a const_reverse_iterator pointing to the end of the reversed vector.
Throws: Nothing.
Complexity: Constant.
Referenced by boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::rend().
|
inline |
|
inline |
|
inline |
Effects: Returns true if the vector contains no elements.
Throws: Nothing.
Complexity: Constant.
Referenced by boost::container::stable_vector_detail::index_traits< VoidPtr, VoidAllocator >::initialize_end_node(), and boost::container::stable_vector_detail::index_traits< VoidPtr, VoidAllocator >::readjust_end_node().
|
inline |
Effects: Returns an iterator to the end of the vector.
Throws: Nothing.
Complexity: Constant.
Referenced by boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::assign(), boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::crbegin(), boost::container::stable_vector_detail::index_traits< VoidPtr, VoidAllocator >::get_fix_up_end(), and boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::rbegin().
|
inline |
Effects: Returns a const_iterator to the end of the vector.
Throws: Nothing.
Complexity: Constant.
|
inline |
Effects: Erases the element at position pos.
Throws: Nothing.
Complexity: Linear to the elements between pos and the last element. Constant if pos is the last element.
|
inline |
Effects: Erases the elements pointed by [first, last).
Throws: Nothing.
Complexity: Linear to the distance between first and last plus linear to the elements between pos and the last element.
|
inline |
Requires: !empty()
Effects: Returns a reference to the first element of the container.
Throws: Nothing.
Complexity: Constant.
|
inline |
Requires: !empty()
Effects: Returns a const reference to the first element of the container.
Throws: Nothing.
Complexity: Constant.
|
inline |
Effects: Returns a copy of the internal allocator.
Throws: If allocator's copy constructor throws.
Complexity: Constant.
|
inline |
Effects: Returns a reference to the internal allocator.
Throws: Nothing
Complexity: Constant.
Note: Non-standard extension.
Referenced by boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::~vector().
|
inline |
Effects: Returns a reference to the internal allocator.
Throws: Nothing
Complexity: Constant.
Note: Non-standard extension.
|
inline |
Requires: p must be a valid iterator of *this.
Effects: Insert n copies of x before pos.
Returns: an iterator to the first inserted element or p if n is 0.
Throws: If memory allocation throws or T's copy/move constructor throws.
Complexity: Linear to n.
Referenced by boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::assign(), and boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::vector().
|
inline |
Requires: p must be a valid iterator of *this.
Effects: Insert a copy of the [first, last) range before pos.
Returns: an iterator to the first inserted element or pos if first == last.
Throws: If memory allocation throws, T's constructor from a dereferenced InpIt throws or T's copy/move constructor/assignment throws.
Complexity: Linear to std::distance [first, last).
|
inline |
|
inline |
Requires: p must be a valid iterator of *this.
num, must be equal to std::distance(first, last)
Effects: Insert a copy of the [first, last) range before pos.
Returns: an iterator to the first inserted element or pos if first == last.
Throws: If memory allocation throws, T's constructor from a dereferenced InpIt throws or T's copy/move constructor/assignment throws.
Complexity: Linear to std::distance [first, last).
Note: This function avoids a linear operation to calculate std::distance[first, last) for forward and bidirectional iterators, and a one by one insertion for input iterators. This is a a non-standard extension.
|
inline |
Requires: position must be a valid iterator of *this.
Effects: Insert a copy of the [il.begin(), il.end()) range before position.
Returns: an iterator to the first inserted element or position if first == last.
Complexity: Linear to the range [il.begin(), il.end()).
|
inline |
|
inline |
Effects: Returns the largest possible size of the vector.
Throws: Nothing.
Complexity: Constant.
|
inline |
|
inline |
Effects: Make *this container contains elements from il.
Complexity: Linear to the range [il.begin(), il.end()).
|
inline |
Effects: Move assignment.
All x's values are transferred to *this.
Postcondition: x.empty(). *this contains a the elements x had before the function.
Throws: If allocator_traits_type::propagate_on_container_move_assignment is false and (allocation throws or value_type's move constructor throws)
Complexity: Constant if allocator_traits_type:: propagate_on_container_move_assignment is true or this->get>allocator() == x.get_allocator(). Linear otherwise.
|
inline |
Effects: Move assignment.
All x's values are transferred to *this.
Postcondition: x.empty(). *this contains a the elements x had before the function.
Throws: If move constructor/assignment of T throws or allocation throws
Complexity: Linear.
Note: Non-standard extension to support static_vector
|
inline |
Effects: Copy assignment.
All x's values are copied to *this.
Postcondition: x.empty(). *this contains a the elements x had before the function.
Throws: If move constructor/assignment of T throws or allocation throws
Complexity: Linear.
Note: Non-standard extension to support static_vector
|
inline |
Requires: size() > n.
Effects: Returns a reference to the nth element from the beginning of the container.
Throws: Nothing.
Complexity: Constant.
|
inline |
Requires: size() > n.
Effects: Returns a const reference to the nth element from the beginning of the container.
Throws: Nothing.
Complexity: Constant.
|
inline |
Effects: Removes the last element from the vector.
Throws: Nothing.
Complexity: Constant time.
|
inline |
Effects: Returns a reverse_iterator pointing to the beginning of the reversed vector.
Throws: Nothing.
Complexity: Constant.
|
inline |
Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed vector.
Throws: Nothing.
Complexity: Constant.
|
inline |
Effects: Returns a reverse_iterator pointing to the end of the reversed vector.
Throws: Nothing.
Complexity: Constant.
|
inline |
Effects: Returns a const_reverse_iterator pointing to the end of the reversed vector.
Throws: Nothing.
Complexity: Constant.
|
inline |
Effects: If n is less than or equal to capacity(), this call has no effect.
Otherwise, it is a request for allocation of additional memory. If the request is successful, then capacity() is greater than or equal to n; otherwise, capacity() is unchanged. In either case, size() is unchanged.
Throws: If memory allocation allocation throws or T's copy/move constructor throws.
Referenced by boost::container::stable_vector_detail::index_traits< VoidPtr, VoidAllocator >::initialize_end_node(), and boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::insert_ordered_at().
|
inline |
Effects: Inserts or erases elements at the end such that the size becomes n.
New elements are value initialized.
Throws: If memory allocation throws, or T's copy/move or value initialization throws.
Complexity: Linear to the difference between size() and new_size.
Referenced by boost::container::stable_vector_detail::index_traits< VoidPtr, VoidAllocator >::initialize_end_node().
|
inline |
Effects: Inserts or erases elements at the end such that the size becomes n.
New elements are default initialized.
Throws: If memory allocation throws, or T's copy/move or default initialization throws.
Complexity: Linear to the difference between size() and new_size.
Note: Non-standard extension
|
inline |
Effects: Inserts or erases elements at the end such that the size becomes n.
New elements are copy constructed from x.
Throws: If memory allocation throws, or T's copy/move constructor throws.
Complexity: Linear to the difference between size() and new_size.
|
inline |
Effects: Tries to deallocate the excess of memory created with previous allocations.
The size of the vector is unchanged
Throws: If memory allocation throws, or T's copy/move constructor throws.
Complexity: Linear to size().
|
inline |
Effects: Returns the number of the elements contained in the vector.
Throws: Nothing.
Complexity: Constant.
Referenced by boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::assign(), and boost::container::vector< Value, container_detail::static_storage_allocator< Value, Capacity > >::insert_ordered_at().
|
inline |
Effects: If n is less than or equal to capacity(), this call has no effect.
Otherwise, it is a request for allocation of additional memory (memory expansion) that will not invalidate iterators. If the request is successful, then capacity() is greater than or equal to n; otherwise, capacity() is unchanged. In either case, size() is unchanged.
Throws: If memory allocation allocation throws or T's copy/move constructor throws.
Note: Non-standard extension.
|
inline |
Effects: Swaps the contents of *this and x.
Throws: Nothing.
Complexity: Constant.
|
inline |
Effects: Swaps the contents of *this and x.
Throws: Nothing.
Complexity: Linear
Note: Non-standard extension to support static_vector
|
friend |
|
friend |
Effects: Returns true if x and y are unequal
Complexity: Linear to the number of elements in the container.
|
friend |
Effects: Returns true if x is less than y
Complexity: Linear to the number of elements in the container.
|
friend |
Effects: Returns true if x is equal or less than y
Complexity: Linear to the number of elements in the container.
|
friend |
Effects: Returns true if x and y are equal
Complexity: Linear to the number of elements in the container.
|
friend |
Effects: Returns true if x is greater than y
Complexity: Linear to the number of elements in the container.
|
friend |
Effects: Returns true if x is equal or greater than y
Complexity: Linear to the number of elements in the container.
|
friend |
Effects: x.swap(y)
Complexity: Constant.