Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::container::stable_vector< T, Allocator > Class Template Reference

Originally developed by Joaquin M. More...

#include <stable_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 node_allocator_type 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
 
 stable_vector ()
 Effects: Default constructs a stable_vector. More...
 
 stable_vector (const allocator_type &al) BOOST_CONTAINER_NOEXCEPT
 Effects: Constructs a stable_vector taking the allocator as parameter. More...
 
 stable_vector (size_type n)
 Effects: Constructs a stable_vector that will use a copy of allocator a and inserts n value initialized values. More...
 
 stable_vector (size_type n, default_init_t)
 Effects: Constructs a stable_vector that will use a copy of allocator a and inserts n default initialized values. More...
 
 stable_vector (size_type n, const T &t, const allocator_type &al=allocator_type())
 Effects: Constructs a stable_vector that will use a copy of allocator a and inserts n copies of value. More...
 
template<class InputIterator >
 stable_vector (InputIterator first, InputIterator last, const allocator_type &al=allocator_type())
 Effects: Constructs a stable_vector that will use a copy of allocator a and inserts a copy of the range [first, last) in the stable_vector. More...
 
 stable_vector (const stable_vector &x)
 Effects: Copy constructs a stable_vector. More...
 
 stable_vector (std::initializer_list< value_type > il, const allocator_type &l=allocator_type())
 Effects: Constructs a stable_vector that will use a copy of allocator a and inserts a copy of the range [il.begin(), il.last()) in the stable_vector More...
 
 stable_vector (BOOST_RV_REF(stable_vector) x)
 Effects: Move constructor. More...
 
 stable_vector (const stable_vector &x, const allocator_type &a)
 Effects: Copy constructs a stable_vector using the specified allocator. More...
 
 stable_vector (BOOST_RV_REF(stable_vector) x, const allocator_type &a)
 Effects: Move constructor using the specified allocator. More...
 
 ~stable_vector ()
 Effects: Destroys the stable_vector. More...
 
stable_vectoroperator= (BOOST_COPY_ASSIGN_REF(stable_vector) x)
 Effects: Makes *this contain the same elements as x. More...
 
stable_vectoroperator= (BOOST_RV_REF(stable_vector) x) BOOST_CONTAINER_NOEXCEPT_IF(allocator_traits_type
 Effects: Move assignment. More...
 
stable_vectoroperator= (std::initializer_list< value_type > il)
 Effects: Make *this container contains elements from il. More...
 
void assign (size_type n, const T &t)
 Effects: Assigns the n copies of val to *this. More...
 
template<typename InputIterator >
void assign (InputIterator first, InputIterator last, typename container_detail::enable_if_c< !container_detail::is_convertible< InputIterator, size_type >::value >::type *=0)
 Effects: Assigns the the range [first, last) to *this. More...
 
void assign (std::initializer_list< value_type > il)
 Effects: Assigns the the range [il.begin(), il.end()) to *this. More...
 
allocator_type get_allocator () const
 Effects: Returns a copy of the internal allocator. More...
 
const stored_allocator_typeget_stored_allocator () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a reference to the internal allocator. More...
 
stored_allocator_typeget_stored_allocator () 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 stable_vector. More...
 
const_iterator begin () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_iterator to the first element contained in the stable_vector. More...
 
iterator end () BOOST_CONTAINER_NOEXCEPT
 Effects: Returns an iterator to the end of the stable_vector. More...
 
const_iterator end () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_iterator to the end of the stable_vector. More...
 
reverse_iterator rbegin () BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a reverse_iterator pointing to the beginning of the reversed stable_vector. More...
 
const_reverse_iterator rbegin () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed stable_vector. More...
 
reverse_iterator rend () BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a reverse_iterator pointing to the end of the reversed stable_vector. More...
 
const_reverse_iterator rend () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_reverse_iterator pointing to the end of the reversed stable_vector. More...
 
const_iterator cbegin () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_iterator to the first element contained in the stable_vector. More...
 
const_iterator cend () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_iterator to the end of the stable_vector. More...
 
const_reverse_iterator crbegin () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed stable_vector. More...
 
const_reverse_iterator crend () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns a const_reverse_iterator pointing to the end of the reversed stable_vector. More...
 
bool empty () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns true if the stable_vector contains no elements. More...
 
size_type size () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns the number of the elements contained in the stable_vector. More...
 
size_type max_size () const BOOST_CONTAINER_NOEXCEPT
 Effects: Returns the largest possible size of the stable_vector. More...
 
void resize (size_type n)
 Effects: Inserts or erases elements at the end such that the size becomes n. More...
 
void resize (size_type n, default_init_t)
 Effects: Inserts or erases elements at the end such that the size becomes n. More...
 
void resize (size_type n, const T &t)
 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 n)
 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...
 
iterator insert (const_iterator p, size_type n, const T &t)
 Requires: p must be a valid iterator of *this. More...
 
iterator insert (const_iterator p, std::initializer_list< value_type > il)
 Requires: p must be a valid iterator of *this. More...
 
template<class InputIterator >
iterator insert (const_iterator p, InputIterator first, InputIterator last, typename container_detail::enable_if_c< !container_detail::is_convertible< InputIterator, size_type >::value &&container_detail::is_input_iterator< InputIterator >::value >::type *=0)
 Requires: pos must be a valid iterator of *this. More...
 
template<class FwdIt >
iterator insert (const_iterator p, 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)
 
void pop_back () BOOST_CONTAINER_NOEXCEPT
 Effects: Removes the last element from the stable_vector. More...
 
iterator erase (const_iterator p) BOOST_CONTAINER_NOEXCEPT
 Effects: Erases the element at p. More...
 
iterator erase (const_iterator first, const_iterator last) BOOST_CONTAINER_NOEXCEPT
 Effects: Erases the elements pointed by [first, last). More...
 
void swap (stable_vector &x)
 Effects: Swaps the contents of *this and x. More...
 
void clear () BOOST_CONTAINER_NOEXCEPT
 Effects: Erases all the elements of the stable_vector. More...
 

Friends

class stable_vector_detail::clear_on_destroy< stable_vector >
 
class insert_rollback
 
class push_back_rollback
 
bool operator== (const stable_vector &x, const stable_vector &y)
 Effects: Returns true if x and y are equal More...
 
bool operator!= (const stable_vector &x, const stable_vector &y)
 Effects: Returns true if x and y are unequal More...
 
bool operator< (const stable_vector &x, const stable_vector &y)
 Effects: Returns true if x is less than y More...
 
bool operator> (const stable_vector &x, const stable_vector &y)
 Effects: Returns true if x is greater than y More...
 
bool operator<= (const stable_vector &x, const stable_vector &y)
 Effects: Returns true if x is equal or less than y More...
 
bool operator>= (const stable_vector &x, const stable_vector &y)
 Effects: Returns true if x is equal or greater than y More...
 
void swap (stable_vector &x, stable_vector &y)
 Effects: x.swap(y) More...
 

Detailed Description

template<class T, class Allocator>
class boost::container::stable_vector< T, Allocator >

Originally developed by Joaquin M.

Lopez Munoz, stable_vector is a std::vector drop-in replacement implemented as a node container, offering iterator and reference stability.

Here are the details taken from the author's blog (Introducing stable_vector):

We present stable_vector, a fully STL-compliant stable container that provides most of the features of std::vector except element contiguity.

General properties: stable_vector satisfies all the requirements of a container, a reversible container and a sequence and provides all the optional operations present in std::vector. Like std::vector, iterators are random access. stable_vector does not provide element contiguity; in exchange for this absence, the container is stable, i.e. references and iterators to an element of a stable_vector remain valid as long as the element is not erased, and an iterator that has been assigned the return value of end() always remain valid until the destruction of the associated stable_vector.

Operation complexity: The big-O complexities of stable_vector operations match exactly those of std::vector. In general, insertion/deletion is constant time at the end of the sequence and linear elsewhere. Unlike std::vector, stable_vector does not internally perform any value_type destruction, copy or assignment operations other than those exactly corresponding to the insertion of new elements or deletion of stored elements, which can sometimes compensate in terms of performance for the extra burden of doing more pointer manipulation and an additional allocation per element.

Exception safety: As stable_vector does not internally copy elements around, some operations provide stronger exception safety guarantees than in std::vector.

Template Parameters
TThe type of object that is stored in the stable_vector
AllocatorThe allocator used for all internal memory management

Member Typedef Documentation

template<class T , class Allocator >
typedef Allocator boost::container::stable_vector< T, Allocator >::allocator_type
template<class T , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::const_pointer boost::container::stable_vector< T, Allocator >::const_pointer
template<class T , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::const_reference boost::container::stable_vector< T, Allocator >::const_reference
template<class T , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::difference_type boost::container::stable_vector< T, Allocator >::difference_type
template<class T , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::pointer boost::container::stable_vector< T, Allocator >::pointer
template<class T , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::reference boost::container::stable_vector< T, Allocator >::reference
template<class T , class Allocator >
typedef ::boost::container::allocator_traits<Allocator>::size_type boost::container::stable_vector< T, Allocator >::size_type
template<class T , class Allocator >
typedef node_allocator_type boost::container::stable_vector< T, Allocator >::stored_allocator_type
template<class T , class Allocator >
typedef T boost::container::stable_vector< T, Allocator >::value_type

Constructor & Destructor Documentation

template<class T , class Allocator >
boost::container::stable_vector< T, Allocator >::stable_vector ( )
inline

Effects: Default constructs a stable_vector.

Throws: If allocator_type's default constructor throws.

Complexity: Constant.

References STABLE_VECTOR_CHECK_INVARIANT.

template<class T , class Allocator >
boost::container::stable_vector< T, Allocator >::stable_vector ( const allocator_type al)
inlineexplicit

Effects: Constructs a stable_vector taking the allocator as parameter.

Throws: Nothing

Complexity: Constant.

References STABLE_VECTOR_CHECK_INVARIANT.

template<class T , class Allocator >
boost::container::stable_vector< T, Allocator >::stable_vector ( size_type  n)
inlineexplicit

Effects: Constructs a stable_vector that will use a copy of allocator a and inserts n value initialized values.

Throws: If allocator_type's default constructor throws or T's default or copy constructor throws.

Complexity: Linear to n.

References boost::container::stable_vector_detail::clear_on_destroy< C >::release(), boost::container::stable_vector< T, Allocator >::resize(), and STABLE_VECTOR_CHECK_INVARIANT.

template<class T , class Allocator >
boost::container::stable_vector< T, Allocator >::stable_vector ( size_type  n,
default_init_t   
)
inline

Effects: Constructs a stable_vector that will use a copy of allocator a and inserts n default initialized values.

Throws: If allocator_type's default constructor throws or T's default or copy constructor throws.

Complexity: Linear to n.

Note: Non-standard extension

References boost::container::stable_vector_detail::clear_on_destroy< C >::release(), boost::container::stable_vector< T, Allocator >::resize(), and STABLE_VECTOR_CHECK_INVARIANT.

template<class T , class Allocator >
boost::container::stable_vector< T, Allocator >::stable_vector ( size_type  n,
const T t,
const allocator_type al = allocator_type() 
)
inline

Effects: Constructs a stable_vector that will use a copy of allocator a and inserts n copies of value.

Throws: If allocator_type's default constructor throws or T's default or copy constructor throws.

Complexity: Linear to n.

References boost::container::stable_vector< T, Allocator >::cend(), boost::container::stable_vector< T, Allocator >::insert(), boost::container::stable_vector_detail::clear_on_destroy< C >::release(), and STABLE_VECTOR_CHECK_INVARIANT.

template<class T , class Allocator >
template<class InputIterator >
boost::container::stable_vector< T, Allocator >::stable_vector ( InputIterator  first,
InputIterator  last,
const allocator_type al = allocator_type() 
)
inline

Effects: Constructs a stable_vector that will use a copy of allocator a and inserts a copy of the range [first, last) in the stable_vector.

Throws: If allocator_type's default constructor throws or T's constructor taking a dereferenced InIt throws.

Complexity: Linear to the range [first, last).

References boost::container::stable_vector< T, Allocator >::cend(), boost::container::stable_vector< T, Allocator >::insert(), boost::container::stable_vector_detail::clear_on_destroy< C >::release(), and STABLE_VECTOR_CHECK_INVARIANT.

template<class T , class Allocator >
boost::container::stable_vector< T, Allocator >::stable_vector ( const stable_vector< T, Allocator > &  x)
inline
template<class T , class Allocator >
boost::container::stable_vector< T, Allocator >::stable_vector ( std::initializer_list< value_type il,
const allocator_type l = allocator_type() 
)
inline

Effects: Constructs a stable_vector that will use a copy of allocator a and inserts a copy of the range [il.begin(), il.last()) in the stable_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()).

template<class T , class Allocator >
boost::container::stable_vector< T, Allocator >::stable_vector ( BOOST_RV_REF(stable_vector< T, Allocator >)  x)
inline

Effects: Move constructor.

Moves mx's resources to *this.

Throws: If allocator_type's copy constructor throws.

Complexity: Constant.

template<class T , class Allocator >
boost::container::stable_vector< T, Allocator >::stable_vector ( const stable_vector< T, Allocator > &  x,
const allocator_type a 
)
inline

Effects: Copy constructs a stable_vector using the specified allocator.

Postcondition: x == *this.

Complexity: Linear to the elements x contains.

References boost::container::stable_vector< T, Allocator >::cend(), boost::container::stable_vector< T, Allocator >::insert(), boost::container::stable_vector_detail::clear_on_destroy< C >::release(), and STABLE_VECTOR_CHECK_INVARIANT.

template<class T , class Allocator >
boost::container::stable_vector< T, Allocator >::stable_vector ( BOOST_RV_REF(stable_vector< T, Allocator >)  x,
const allocator_type a 
)
inline

Effects: Move constructor using the specified allocator.

Moves mx's resources to *this.

Throws: If allocator_type's copy constructor throws.

Complexity: Constant if a == x.get_allocator(), linear otherwise

References boost::container::stable_vector< T, Allocator >::cend(), boost::container::stable_vector< T, Allocator >::insert(), boost::container::stable_vector_detail::clear_on_destroy< C >::release(), and STABLE_VECTOR_CHECK_INVARIANT.

template<class T , class Allocator >
boost::container::stable_vector< T, Allocator >::~stable_vector ( )
inline

Effects: Destroys the stable_vector.

All stored values are destroyed and used memory is deallocated.

Throws: Nothing.

Complexity: Linear to the number of elements.

References boost::container::stable_vector< T, Allocator >::clear().

Member Function Documentation

template<class T , class Allocator >
void boost::container::stable_vector< T, Allocator >::assign ( size_type  n,
const T t 
)
inline

Effects: Assigns the n copies of val to *this.

Throws: If memory allocation throws or T's copy constructor throws.

Complexity: Linear to n.

Referenced by boost::container::stable_vector< T, Allocator >::operator=().

template<class T , class Allocator >
template<typename InputIterator >
void boost::container::stable_vector< T, Allocator >::assign ( InputIterator  first,
InputIterator  last,
typename container_detail::enable_if_c< !container_detail::is_convertible< InputIterator, size_type >::value >::type = 0 
)
inline

Effects: Assigns the the range [first, last) to *this.

Throws: If memory allocation throws or T's constructor from dereferencing InpIt throws.

Complexity: Linear to n.

References boost::container::stable_vector< T, Allocator >::begin(), boost::container::stable_vector< T, Allocator >::end(), boost::container::stable_vector< T, Allocator >::erase(), boost::xpressive::first, boost::container::stable_vector< T, Allocator >::insert(), boost::last, and STABLE_VECTOR_CHECK_INVARIANT.

template<class T , class Allocator >
void boost::container::stable_vector< T, Allocator >::assign ( std::initializer_list< value_type il)
inline

Effects: Assigns the the range [il.begin(), il.end()) to *this.

Throws: If memory allocation throws or T's constructor from dereferencing initializer_list iterator throws.

template<class T , class Allocator >
reference boost::container::stable_vector< T, Allocator >::at ( size_type  n)
inline

Requires: size() > n.

Effects: Returns a reference to the nth element from the beginning of the container.

Throws: std::range_error if n >= size()

Complexity: Constant.

References boost::container::stable_vector< T, Allocator >::operator[](), boost::container::stable_vector< T, Allocator >::size(), and boost::container::throw_out_of_range().

template<class T , class Allocator >
const_reference boost::container::stable_vector< T, Allocator >::at ( size_type  n) const
inline

Requires: size() > n.

Effects: Returns a const reference to the nth element from the beginning of the container.

Throws: std::range_error if n >= size()

Complexity: Constant.

References boost::container::stable_vector< T, Allocator >::operator[](), boost::container::stable_vector< T, Allocator >::size(), and boost::container::throw_out_of_range().

template<class T , class Allocator >
reference boost::container::stable_vector< T, Allocator >::back ( )
inline

Requires: !empty()

Effects: Returns a reference to the last element of the container.

Throws: Nothing.

Complexity: Constant.

References boost::container::stable_vector< T, Allocator >::size(), and boost::program_options::value().

template<class T , class Allocator >
const_reference boost::container::stable_vector< T, Allocator >::back ( ) const
inline

Requires: !empty()

Effects: Returns a const reference to the last element of the container.

Throws: Nothing.

Complexity: Constant.

References boost::container::stable_vector< T, Allocator >::size(), and boost::program_options::value().

template<class T , class Allocator >
const_iterator boost::container::stable_vector< T, Allocator >::begin ( ) const
inline

Effects: Returns a const_iterator to the first element contained in the stable_vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::stable_vector< T, Allocator >::cend(), and boost::intrusive::pointer_traits< Ptr >::static_cast_from().

template<class T , class Allocator >
typedef boost::container::stable_vector< T, Allocator >::BOOST_CONTAINER_IMPDEF ( iterator_impl  )
template<class T , class Allocator >
typedef boost::container::stable_vector< T, Allocator >::BOOST_CONTAINER_IMPDEF ( const_iterator_impl  ) const
template<class T , class Allocator >
typedef boost::container::stable_vector< T, Allocator >::BOOST_CONTAINER_IMPDEF ( container_detail::reverse_iterator< iterator >  )
template<class T , class Allocator >
typedef boost::container::stable_vector< T, Allocator >::BOOST_CONTAINER_IMPDEF ( container_detail::reverse_iterator< const_iterator >  ) const
template<class T , class Allocator >
size_type boost::container::stable_vector< T, Allocator >::capacity ( ) 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.

References BOOST_ASSERT.

Referenced by boost::container::stable_vector< T, Allocator >::reserve(), and boost::container::stable_vector< T, Allocator >::shrink_to_fit().

template<class T , class Allocator >
const_iterator boost::container::stable_vector< T, Allocator >::cbegin ( ) const
inline
template<class T , class Allocator >
const_reverse_iterator boost::container::stable_vector< T, Allocator >::crbegin ( ) const
inline

Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed stable_vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::stable_vector< T, Allocator >::rbegin().

template<class T , class Allocator >
const_reverse_iterator boost::container::stable_vector< T, Allocator >::crend ( ) const
inline

Effects: Returns a const_reverse_iterator pointing to the end of the reversed stable_vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::stable_vector< T, Allocator >::rend().

template<class T , class Allocator >
bool boost::container::stable_vector< T, Allocator >::empty ( ) const
inline

Effects: Returns true if the stable_vector contains no elements.

Throws: Nothing.

Complexity: Constant.

Referenced by boost::container::stable_vector< T, Allocator >::shrink_to_fit().

template<class T , class Allocator >
iterator boost::container::stable_vector< T, Allocator >::end ( )
inline
template<class T , class Allocator >
const_iterator boost::container::stable_vector< T, Allocator >::end ( ) const
inline

Effects: Returns a const_iterator to the end of the stable_vector.

Throws: Nothing.

Complexity: Constant.

template<class T , class Allocator >
iterator boost::container::stable_vector< T, Allocator >::erase ( const_iterator  first,
const_iterator  last 
)
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 p and the last element.

References boost::container::stable_vector< T, Allocator >::cbegin(), boost::container::stable_vector_detail::index_traits< VoidPtr, VoidAllocator >::fix_up_pointers_from(), boost::it, boost::intrusive::pointer_traits< Ptr >::pointer_to(), STABLE_VECTOR_CHECK_INVARIANT, and boost::intrusive::pointer_traits< Ptr >::static_cast_from().

template<class T , class Allocator >
reference boost::container::stable_vector< T, Allocator >::front ( )
inline

Requires: !empty()

Effects: Returns a reference to the first element of the container.

Throws: Nothing.

Complexity: Constant.

References boost::program_options::value().

template<class T , class Allocator >
const_reference boost::container::stable_vector< T, Allocator >::front ( ) const
inline

Requires: !empty()

Effects: Returns a const reference to the first element of the container.

Throws: Nothing.

Complexity: Constant.

References boost::program_options::value().

template<class T , class Allocator >
allocator_type boost::container::stable_vector< T, Allocator >::get_allocator ( ) const
inline

Effects: Returns a copy of the internal allocator.

Throws: If allocator's copy constructor throws.

Complexity: Constant.

template<class T , class Allocator >
const stored_allocator_type& boost::container::stable_vector< T, Allocator >::get_stored_allocator ( ) const
inline

Effects: Returns a reference to the internal allocator.

Throws: Nothing

Complexity: Constant.

Note: Non-standard extension.

template<class T , class Allocator >
stored_allocator_type& boost::container::stable_vector< T, Allocator >::get_stored_allocator ( )
inline

Effects: Returns a reference to the internal allocator.

Throws: Nothing

Complexity: Constant.

Note: Non-standard extension.

template<class T , class Allocator >
iterator boost::container::stable_vector< T, Allocator >::insert ( const_iterator  p,
size_type  n,
const T t 
)
inline

Requires: p must be a valid iterator of *this.

Effects: Insert n copies of x before p.

Returns: an iterator to the first inserted element or p if n is 0.

Throws: If memory allocation throws or T's copy constructor throws.

Complexity: Linear to n.

References STABLE_VECTOR_CHECK_INVARIANT.

Referenced by boost::container::stable_vector< T, Allocator >::assign(), boost::container::stable_vector< T, Allocator >::resize(), and boost::container::stable_vector< T, Allocator >::stable_vector().

template<class T , class Allocator >
iterator boost::container::stable_vector< T, Allocator >::insert ( const_iterator  p,
std::initializer_list< value_type il 
)
inline

Requires: p must be a valid iterator of *this.

Requires: p must be a valid iterator of *this.

Effects: Insert a copy of the [il.begin(), il.end()) range before p.

Returns: an iterator to the first inserted element or p if first == last.

Complexity: Linear to std::distance [il.begin(), il.end()).

template<class T , class Allocator >
template<class InputIterator >
iterator boost::container::stable_vector< T, Allocator >::insert ( const_iterator  p,
InputIterator  first,
InputIterator  last,
typename container_detail::enable_if_c< !container_detail::is_convertible< InputIterator, size_type >::value &&container_detail::is_input_iterator< InputIterator >::value >::type = 0 
)
inline

Requires: pos must be a valid iterator of *this.

Effects: Insert a copy of the [first, last) range before p.

Returns: an iterator to the first inserted element or p if first == last.

Throws: If memory allocation throws, T's constructor from a dereferenced InpIt throws or T's copy constructor throws.

Complexity: Linear to std::distance [first, last).

References boost::container::stable_vector< T, Allocator >::begin(), boost::container::stable_vector< T, Allocator >::cbegin(), boost::xpressive::first, boost::last, and STABLE_VECTOR_CHECK_INVARIANT.

template<class T , class Allocator >
template<class FwdIt >
iterator boost::container::stable_vector< T, Allocator >::insert ( const_iterator  p,
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 
)
inline
template<class T , class Allocator >
size_type boost::container::stable_vector< T, Allocator >::max_size ( ) const
inline

Effects: Returns the largest possible size of the stable_vector.

Throws: Nothing.

Complexity: Constant.

Referenced by boost::container::stable_vector< T, Allocator >::reserve().

template<class T , class Allocator >
stable_vector& boost::container::stable_vector< T, Allocator >::operator= ( BOOST_COPY_ASSIGN_REF(stable_vector< T, Allocator >)  x)
inline

Effects: Makes *this contain the same elements as x.

Postcondition: this->size() == x.size(). *this contains a copy of each of x's elements.

Throws: If memory allocation throws or T's copy constructor throws.

Complexity: Linear to the number of elements in x.

References boost::container::stable_vector< T, Allocator >::assign(), boost::spirit::x3::bool_, boost::container::stable_vector< T, Allocator >::clear(), boost::container::stable_vector< T, Allocator >::shrink_to_fit(), STABLE_VECTOR_CHECK_INVARIANT, and boost::program_options::value().

template<class T , class Allocator >
stable_vector& boost::container::stable_vector< T, Allocator >::operator= ( BOOST_RV_REF(stable_vector< T, Allocator >)  x)
inline

Effects: Move assignment.

All mx'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 T'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.

References boost::container::stable_vector< T, Allocator >::assign(), BOOST_ASSERT, boost::container::stable_vector< T, Allocator >::clear(), boost::make_move_iterator(), boost::move(), boost::program_options::value(), boost::detail::void, and boost::flyweights::x.

template<class T , class Allocator >
stable_vector& boost::container::stable_vector< T, Allocator >::operator= ( std::initializer_list< value_type il)
inline

Effects: Make *this container contains elements from il.

Complexity: Linear to the range [il.begin(), il.end()).

template<class T , class Allocator >
reference boost::container::stable_vector< T, Allocator >::operator[] ( size_type  n)
inline

Requires: size() > n.

Effects: Returns a reference to the nth element from the beginning of the container.

Throws: Nothing.

Complexity: Constant.

References BOOST_ASSERT, boost::n, boost::container::stable_vector< T, Allocator >::size(), and boost::program_options::value().

Referenced by boost::container::stable_vector< T, Allocator >::at().

template<class T , class Allocator >
const_reference boost::container::stable_vector< T, Allocator >::operator[] ( size_type  n) const
inline

Requires: size() > n.

Effects: Returns a const reference to the nth element from the beginning of the container.

Throws: Nothing.

Complexity: Constant.

References BOOST_ASSERT, boost::n, boost::container::stable_vector< T, Allocator >::size(), and boost::program_options::value().

template<class T , class Allocator >
void boost::container::stable_vector< T, Allocator >::pop_back ( )
inline

Effects: Removes the last element from the stable_vector.

Throws: Nothing.

Complexity: Constant time.

References boost::container::stable_vector< T, Allocator >::cend(), and boost::container::stable_vector< T, Allocator >::erase().

template<class T , class Allocator >
reverse_iterator boost::container::stable_vector< T, Allocator >::rbegin ( )
inline

Effects: Returns a reverse_iterator pointing to the beginning of the reversed stable_vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::stable_vector< T, Allocator >::end().

Referenced by boost::container::stable_vector< T, Allocator >::crbegin().

template<class T , class Allocator >
const_reverse_iterator boost::container::stable_vector< T, Allocator >::rbegin ( ) const
inline

Effects: Returns a const_reverse_iterator pointing to the beginning of the reversed stable_vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::stable_vector< T, Allocator >::end().

template<class T , class Allocator >
reverse_iterator boost::container::stable_vector< T, Allocator >::rend ( )
inline

Effects: Returns a reverse_iterator pointing to the end of the reversed stable_vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::stable_vector< T, Allocator >::begin().

Referenced by boost::container::stable_vector< T, Allocator >::crend().

template<class T , class Allocator >
const_reverse_iterator boost::container::stable_vector< T, Allocator >::rend ( ) const
inline

Effects: Returns a const_reverse_iterator pointing to the end of the reversed stable_vector.

Throws: Nothing.

Complexity: Constant.

References boost::container::stable_vector< T, Allocator >::begin().

template<class T , class Allocator >
void boost::container::stable_vector< T, Allocator >::reserve ( size_type  n)
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.

References boost::container::stable_vector< T, Allocator >::capacity(), boost::container::stable_vector_detail::index_traits< VoidPtr, VoidAllocator >::fix_up_pointers_from(), boost::container::stable_vector_detail::index_traits< VoidPtr, VoidAllocator >::initialize_end_node(), boost::container::stable_vector< T, Allocator >::max_size(), boost::container::stable_vector< T, Allocator >::size(), STABLE_VECTOR_CHECK_INVARIANT, and boost::container::throw_length_error().

template<class T , class Allocator >
void boost::container::stable_vector< T, Allocator >::resize ( size_type  n)
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 value initialization throws.

Complexity: Linear to the difference between size() and new_size.

References boost::container::stable_vector< T, Allocator >::cbegin(), boost::container::stable_vector< T, Allocator >::cend(), boost::container::stable_vector< T, Allocator >::erase(), boost::container::stable_vector< T, Allocator >::insert(), boost::container::stable_vector< T, Allocator >::size(), and STABLE_VECTOR_CHECK_INVARIANT.

Referenced by boost::container::stable_vector< T, Allocator >::stable_vector().

template<class T , class Allocator >
void boost::container::stable_vector< T, Allocator >::resize ( size_type  n,
default_init_t   
)
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 default initialization throws.

Complexity: Linear to the difference between size() and new_size.

Note: Non-standard extension

References boost::container::stable_vector< T, Allocator >::cbegin(), boost::container::stable_vector< T, Allocator >::cend(), boost::container::stable_vector< T, Allocator >::erase(), boost::container::stable_vector< T, Allocator >::insert(), boost::container::stable_vector< T, Allocator >::size(), and STABLE_VECTOR_CHECK_INVARIANT.

template<class T , class Allocator >
void boost::container::stable_vector< T, Allocator >::resize ( size_type  n,
const T t 
)
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 constructor throws.

Complexity: Linear to the difference between size() and new_size.

References boost::container::stable_vector< T, Allocator >::cbegin(), boost::container::stable_vector< T, Allocator >::cend(), boost::container::stable_vector< T, Allocator >::erase(), boost::container::stable_vector< T, Allocator >::insert(), boost::container::stable_vector< T, Allocator >::size(), and STABLE_VECTOR_CHECK_INVARIANT.

template<class T , class Allocator >
void boost::container::stable_vector< T, Allocator >::shrink_to_fit ( )
inline

Effects: Tries to deallocate the excess of memory created with previous allocations.

The size of the stable_vector is unchanged

Throws: If memory allocation throws.

Complexity: Linear to size().

References boost::container::stable_vector< T, Allocator >::capacity(), boost::container::stable_vector< T, Allocator >::empty(), and boost::container::stable_vector_detail::index_traits< VoidPtr, VoidAllocator >::fix_up_pointers_from().

Referenced by boost::container::stable_vector< T, Allocator >::operator=().

template<class T , class Allocator >
void boost::container::stable_vector< T, Allocator >::swap ( stable_vector< T, Allocator > &  x)
inline

Effects: Swaps the contents of *this and x.

Throws: Nothing.

Complexity: Constant.

References STABLE_VECTOR_CHECK_INVARIANT.

Friends And Related Function Documentation

template<class T , class Allocator >
friend class insert_rollback
friend
template<class T , class Allocator >
bool operator!= ( const stable_vector< T, Allocator > &  x,
const stable_vector< T, Allocator > &  y 
)
friend

Effects: Returns true if x and y are unequal

Complexity: Linear to the number of elements in the container.

template<class T , class Allocator >
bool operator< ( const stable_vector< T, Allocator > &  x,
const stable_vector< T, Allocator > &  y 
)
friend

Effects: Returns true if x is less than y

Complexity: Linear to the number of elements in the container.

template<class T , class Allocator >
bool operator<= ( const stable_vector< T, Allocator > &  x,
const stable_vector< T, Allocator > &  y 
)
friend

Effects: Returns true if x is equal or less than y

Complexity: Linear to the number of elements in the container.

template<class T , class Allocator >
bool operator== ( const stable_vector< T, Allocator > &  x,
const stable_vector< T, Allocator > &  y 
)
friend

Effects: Returns true if x and y are equal

Complexity: Linear to the number of elements in the container.

template<class T , class Allocator >
bool operator> ( const stable_vector< T, Allocator > &  x,
const stable_vector< T, Allocator > &  y 
)
friend

Effects: Returns true if x is greater than y

Complexity: Linear to the number of elements in the container.

template<class T , class Allocator >
bool operator>= ( const stable_vector< T, Allocator > &  x,
const stable_vector< T, Allocator > &  y 
)
friend

Effects: Returns true if x is equal or greater than y

Complexity: Linear to the number of elements in the container.

template<class T , class Allocator >
friend class push_back_rollback
friend
template<class T , class Allocator >
friend class stable_vector_detail::clear_on_destroy< stable_vector >
friend
template<class T , class Allocator >
void swap ( stable_vector< T, Allocator > &  x,
stable_vector< T, Allocator > &  y 
)
friend

Effects: x.swap(y)

Complexity: Constant.


The documentation for this class was generated from the following files: