rosidl_runtime_cpp  master
Generate the rosidl interfaces in C++.
Public Member Functions | Friends | List of all members
rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc > Class Template Reference

A container based on std::vector but with an upper bound. More...

#include <bounded_vector.hpp>

Inheritance diagram for rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >:
Inheritance graph
[legend]
Collaboration diagram for rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >:
Collaboration graph
[legend]

Public Member Functions

 BoundedVector () noexcept(std::is_nothrow_default_constructible< Alloc >::value)
 Create a BoundedVector with no elements. More...
 
 BoundedVector (const typename Base::allocator_type &a) noexcept
 Creates a BoundedVector with no elements. More...
 
 BoundedVector (typename Base::size_type n, const typename Base::allocator_type &a=allocator_type())
 Create a BoundedVector with default constructed elements. More...
 
 BoundedVector (typename Base::size_type n, const typename Base::value_type &value, const typename Base::allocator_type &a=allocator_type())
 Create a BoundedVector with copies of an exemplar element. More...
 
 BoundedVector (const BoundedVector &x)
 BoundedVector copy constructor. More...
 
 BoundedVector (BoundedVector &&x) noexcept
 BoundedVector move constructor. More...
 
 BoundedVector (const BoundedVector &x, const typename Base::allocator_type &a)
 Copy constructor with alternative allocator. More...
 
 BoundedVector (std::initializer_list< typename Base::value_type > l, const typename Base::allocator_type &a=typename Base::allocator_type())
 Build a BoundedVector from an initializer list. More...
 
template<typename InputIterator >
 BoundedVector (InputIterator first, InputIterator last, const typename Base::allocator_type &a=allocator_type())
 Build a BoundedVector from a range. More...
 
 ~BoundedVector () noexcept
 The dtor only erases the elements. More...
 
BoundedVectoroperator= (const BoundedVector &x)
 BoundedVector assignment operator. More...
 
BoundedVectoroperator= (BoundedVector &&x)
 BoundedVector move assignment operator More...
 
BoundedVectoroperator= (std::initializer_list< typename Base::value_type > l)
 BoundedVector list assignment operator. More...
 
void assign (typename Base::size_type n, const typename Base::value_type &val)
 Assign a given value to a BoundedVector. More...
 
template<typename InputIterator >
void assign (InputIterator first, InputIterator last)
 Assign a range to a BoundedVector. More...
 
void assign (std::initializer_list< typename Base::value_type > l)
 Assign an initializer list to a BoundedVector. More...
 
Base::size_type max_size () const noexcept
 
void resize (typename Base::size_type new_size)
 Resize the BoundedVector to the specified number of elements. More...
 
void resize (typename Base::size_type new_size, const typename Base::value_type &x)
 Resize the BoundedVector to the specified number of elements. More...
 
void reserve (typename Base::size_type n)
 Attempt to preallocate enough memory for specified number of elements. More...
 
template<typename T , typename std::enable_if< !std::is_same< T, Tp >::value &&!std::is_same< T, bool >::value >::type * = nullptr>
T * data () noexcept
 Return a pointer such that [data(), data() + size()) is a valid range. More...
 
template<typename T , typename std::enable_if< !std::is_same< T, Tp >::value &&!std::is_same< T, bool >::value >::type * = nullptr>
const T * data () const noexcept
 
void push_back (const typename Base::value_type &x)
 Add data to the end of the BoundedVector. More...
 
void push_back (typename Base::value_type &&x)
 
template<typename ... Args>
auto emplace_back (Args &&... args)
 Add data to the end of the BoundedVector. More...
 
template<typename ... Args>
Base::iterator emplace (typename Base::const_iterator position, Args &&... args)
 Insert an object in BoundedVector before specified iterator. More...
 
Base::iterator insert (typename Base::const_iterator position, const typename Base::value_type &x)
 Insert given value into BoundedVector before specified iterator. More...
 
Base::iterator insert (typename Base::const_iterator position, typename Base::value_type &&x)
 Insert given rvalue into BoundedVector before specified iterator. More...
 
Base::iterator insert (typename Base::const_iterator position, std::initializer_list< typename Base::value_type > l)
 Insert an initializer_list into the BoundedVector. More...
 
Base::iterator insert (typename Base::const_iterator position, typename Base::size_type n, const typename Base::value_type &x)
 Insert a number of copies of given data into the BoundedVector. More...
 
template<typename InputIterator >
Base::iterator insert (typename Base::const_iterator position, InputIterator first, InputIterator last)
 Insert a range into the BoundedVector. More...
 
begin (T... args)
 
end (T... args)
 
rbegin (T... args)
 
rend (T... args)
 
cbegin (T... args)
 
cend (T... args)
 
crbegin (T... args)
 
crend (T... args)
 
size (T... args)
 
shrink_to_fit (T... args)
 
capacity (T... args)
 
empty (T... args)
 
at (T... args)
 
front (T... args)
 
back (T... args)
 
erase (T... args)
 
pop_back (T... args)
 
clear (T... args)
 

Friends

bool operator== (const BoundedVector &x, const BoundedVector &y)
 Vector equality comparison. More...
 
bool operator< (const BoundedVector &x, const BoundedVector &y)
 Vector ordering relation. More...
 
bool operator!= (const BoundedVector &x, const BoundedVector &y)
 Based on operator==. More...
 
bool operator> (const BoundedVector &x, const BoundedVector &y)
 Based on operator<. More...
 
bool operator<= (const BoundedVector &x, const BoundedVector &y)
 Based on operator<. More...
 
bool operator>= (const BoundedVector &x, const BoundedVector &y)
 Based on operator<. More...
 

Additional Inherited Members

- Protected Member Functions inherited from std::vector< Tp, std::allocator< Tp > >
push_back (T... args)
 
crbegin (T... args)
 
erase (T... args)
 
data (T... args)
 
insert (T... args)
 
pop_back (T... args)
 
shrink_to_fit (T... args)
 
back (T... args)
 
end (T... args)
 
resize (T... args)
 
emplace_back (T... args)
 
size (T... args)
 
cbegin (T... args)
 
front (T... args)
 
~vector (T... args)
 
rbegin (T... args)
 
crend (T... args)
 
assign (T... args)
 
operator= (T... args)
 
vector (T... args)
 
reserve (T... args)
 
capacity (T... args)
 
empty (T... args)
 
cend (T... args)
 
swap (T... args)
 
max_size (T... args)
 
rend (T... args)
 
get_allocator (T... args)
 
clear (T... args)
 
at (T... args)
 
emplace (T... args)
 
operator[] (T... args)
 
begin (T... args)
 

Detailed Description

template<typename Tp, std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
class rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >

A container based on std::vector but with an upper bound.

Meets the same requirements as std::vector.

Parameters
TpType of element
UpperBoundThe upper bound for the number of elements
AllocAllocator type, defaults to std::allocator<Tp>

Constructor & Destructor Documentation

◆ BoundedVector() [1/9]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::BoundedVector ( )
inlinenoexcept

Create a BoundedVector with no elements.

◆ BoundedVector() [2/9]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::BoundedVector ( const typename Base::allocator_type &  a)
inlineexplicitnoexcept

Creates a BoundedVector with no elements.

Parameters
aAn allocator object

◆ BoundedVector() [3/9]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::BoundedVector ( typename Base::size_type  n,
const typename Base::allocator_type &  a = allocator_type() 
)
inlineexplicit

Create a BoundedVector with default constructed elements.

This constructor fills the BoundedVector with n default constructed elements.

Parameters
nThe number of elements to initially create
aAn allocator

◆ BoundedVector() [4/9]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::BoundedVector ( typename Base::size_type  n,
const typename Base::value_type &  value,
const typename Base::allocator_type &  a = allocator_type() 
)
inline

Create a BoundedVector with copies of an exemplar element.

This constructor fills the BoundedVector with n copies of value.

Parameters
nThe number of elements to initially create
valueAn element to copy
aAn allocator

◆ BoundedVector() [5/9]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::BoundedVector ( const BoundedVector< Tp, UpperBound, Alloc > &  x)
inline

BoundedVector copy constructor.

The newly-created BoundedVector uses a copy of the allocation object used by x. All the elements of x are copied, but any extra memory in x (for fast expansion) will not be copied.

Parameters
xA BoundedVector of identical element and allocator types

◆ BoundedVector() [6/9]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::BoundedVector ( BoundedVector< Tp, UpperBound, Alloc > &&  x)
inlinenoexcept

BoundedVector move constructor.

The newly-created BoundedVector contains the exact contents of x. The contents of x are a valid, but unspecified BoundedVector.

Parameters
xA BoundedVector of identical element and allocator types

◆ BoundedVector() [7/9]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::BoundedVector ( const BoundedVector< Tp, UpperBound, Alloc > &  x,
const typename Base::allocator_type &  a 
)
inline

Copy constructor with alternative allocator.

◆ BoundedVector() [8/9]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::BoundedVector ( std::initializer_list< typename Base::value_type >  l,
const typename Base::allocator_type &  a = typename Base::allocator_type() 
)
inline

Build a BoundedVector from an initializer list.

Create a BoundedVector consisting of copies of the elements in the initializer_list l.

This will call the element type's copy constructor N times (where N is l.size()) and do no memory reallocation.

Parameters
lAn initializer_list
aAn allocator

◆ BoundedVector() [9/9]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
template<typename InputIterator >
rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::BoundedVector ( InputIterator  first,
InputIterator  last,
const typename Base::allocator_type &  a = allocator_type() 
)
inline

Build a BoundedVector from a range.

Create a BoundedVector consisting of copies of the elements from [first,last).

If the iterators are forward, bidirectional, or random-access, then this will call the elements' copy constructor N times (where N is distance(first,last)) and do no memory reallocation. But if only input iterators are used, then this will do at most 2N calls to the copy constructor, and logN memory reallocations.

Parameters
firstAn input iterator
lastAn input iterator
aAn allocator

◆ ~BoundedVector()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::~BoundedVector ( )
inlinenoexcept

The dtor only erases the elements.

Note that if the elements themselves are pointers, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibility.

Member Function Documentation

◆ operator=() [1/3]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
BoundedVector& rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::operator= ( const BoundedVector< Tp, UpperBound, Alloc > &  x)
inline

BoundedVector assignment operator.

All the elements of x are copied, but any extra memory in x (for fast expansion) will not be copied. Unlike the copy constructor, the allocator object is not copied.

Parameters
xA BoundedVector of identical element and allocator types

◆ operator=() [2/3]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
BoundedVector& rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::operator= ( BoundedVector< Tp, UpperBound, Alloc > &&  x)
inline

BoundedVector move assignment operator

Parameters
xA BoundedVector of identical element and allocator types.

◆ operator=() [3/3]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
BoundedVector& rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::operator= ( std::initializer_list< typename Base::value_type >  l)
inline

BoundedVector list assignment operator.

This function fills a BoundedVector with copies of the elements in the initializer list l.

Note that the assignment completely changes the BoundedVector and that the resulting BoundedVector's size is the same as the number of elements assigned. Old data may be lost.

Parameters
lAn initializer_list

◆ assign() [1/3]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
void rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::assign ( typename Base::size_type  n,
const typename Base::value_type &  val 
)
inline

Assign a given value to a BoundedVector.

This function fills a BoundedVector with n copies of the given value. Note that the assignment completely changes the BoundedVector and that the resulting BoundedVector's size is the same as the number of elements assigned. Old data may be lost.

Parameters
nNumber of elements to be assigned
valValue to be assigned

◆ assign() [2/3]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
template<typename InputIterator >
void rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::assign ( InputIterator  first,
InputIterator  last 
)
inline

Assign a range to a BoundedVector.

This function fills a BoundedVector with copies of the elements in the range [first,last).

Note that the assignment completely changes the BoundedVector and that the resulting BoundedVector's size is the same as the number of elements assigned. Old data may be lost.

Parameters
firstAn input iterator
lastAn input iterator

◆ assign() [3/3]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
void rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::assign ( std::initializer_list< typename Base::value_type >  l)
inline

Assign an initializer list to a BoundedVector.

This function fills a BoundedVector with copies of the elements in the initializer list l.

Note that the assignment completely changes the BoundedVector and that the resulting BoundedVector's size is the same as the number of elements assigned. Old data may be lost.

Parameters
lAn initializer_list

◆ max_size()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
Base::size_type rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::max_size ( ) const
inlinenoexcept

Returns the size() of the largest possible BoundedVector.

◆ resize() [1/2]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
void rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::resize ( typename Base::size_type  new_size)
inline

Resize the BoundedVector to the specified number of elements.

This function will resize the BoundedVector to the specified number of elements. If the number is smaller than the BoundedVector's current size the BoundedVector is truncated, otherwise default constructed elements are appended.

Parameters
new_sizeNumber of elements the BoundedVector should contain

◆ resize() [2/2]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
void rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::resize ( typename Base::size_type  new_size,
const typename Base::value_type &  x 
)
inline

Resize the BoundedVector to the specified number of elements.

This function will resize the BoundedVector to the specified number of elements. If the number is smaller than the BoundedVector's current size the BoundedVector is truncated, otherwise the BoundedVector is extended and new elements are populated with given data.

Parameters
new_sizeNumber of elements the BoundedVector should contain
xData with which new elements should be populated

◆ reserve()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
void rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::reserve ( typename Base::size_type  n)
inline

Attempt to preallocate enough memory for specified number of elements.

This function attempts to reserve enough memory for the BoundedVector to hold the specified number of elements. If the number requested is more than max_size(), length_error is thrown.

The advantage of this function is that if optimal code is a necessity and the user can determine the number of elements that will be required, the user can reserve the memory in advance, and thus prevent a possible reallocation of memory and copying of BoundedVector data.

Parameters
nNumber of elements required
Exceptions
std::length_errorIf n exceeds max_size()

◆ data() [1/2]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
template<typename T , typename std::enable_if< !std::is_same< T, Tp >::value &&!std::is_same< T, bool >::value >::type * = nullptr>
T* rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::data ( )
inlinenoexcept

Return a pointer such that [data(), data() + size()) is a valid range.

For a non-empty BoundedVector, data() == &front().

◆ data() [2/2]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
template<typename T , typename std::enable_if< !std::is_same< T, Tp >::value &&!std::is_same< T, bool >::value >::type * = nullptr>
const T* rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::data ( ) const
inlinenoexcept

◆ push_back() [1/2]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
void rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::push_back ( const typename Base::value_type &  x)
inline

Add data to the end of the BoundedVector.

This is a typical stack operation. The function creates an element at the end of the BoundedVector and assigns the given data to it. Due to the nature of a BoundedVector this operation can be done in constant time if the BoundedVector has preallocated space available.

Parameters
xData to be added

◆ push_back() [2/2]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
void rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::push_back ( typename Base::value_type &&  x)
inline

◆ emplace_back()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
template<typename ... Args>
auto rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::emplace_back ( Args &&...  args)
inline

Add data to the end of the BoundedVector.

This is a typical stack operation. The function creates an element at the end of the BoundedVector and assigns the given data to it. Due to the nature of a BoundedVector this operation can be done in constant time if the BoundedVector has preallocated space available.

Parameters
argsArguments to be forwarded to the constructor of Tp

◆ emplace()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
template<typename ... Args>
Base::iterator rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::emplace ( typename Base::const_iterator  position,
Args &&...  args 
)
inline

Insert an object in BoundedVector before specified iterator.

This function will insert an object of type T constructed with T(std::forward<Args>(args)...) before the specified location. Note that this kind of operation could be expensive for a BoundedVector and if it is frequently used the user should consider using std::list.

Parameters
positionA const_iterator into the BoundedVector
argsArguments
Returns
An iterator that points to the inserted data

◆ insert() [1/5]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
Base::iterator rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::insert ( typename Base::const_iterator  position,
const typename Base::value_type &  x 
)
inline

Insert given value into BoundedVector before specified iterator.

This function will insert a copy of the given value before the specified location. Note that this kind of operation could be expensive for a BoundedVector and if it is frequently used the user should consider using std::list.

Parameters
positionA const_iterator into the BoundedVector
xData to be inserted
Returns
An iterator that points to the inserted data

◆ insert() [2/5]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
Base::iterator rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::insert ( typename Base::const_iterator  position,
typename Base::value_type &&  x 
)
inline

Insert given rvalue into BoundedVector before specified iterator.

This function will insert a copy of the given rvalue before the specified location. Note that this kind of operation could be expensive for a BoundedVector and if it is frequently used the user should consider using std::list.

Parameters
positionA const_iterator into the BoundedVector
xData to be inserted
Returns
An iterator that points to the inserted data

◆ insert() [3/5]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
Base::iterator rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::insert ( typename Base::const_iterator  position,
std::initializer_list< typename Base::value_type >  l 
)
inline

Insert an initializer_list into the BoundedVector.

This function will insert copies of the data in the initializer_list l into the BoundedVector before the location specified by position.

Note that this kind of operation could be expensive for a BoundedVector and if it is frequently used the user should consider using std::list.

Parameters
positionAn iterator into the BoundedVector
lAn initializer_list

◆ insert() [4/5]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
Base::iterator rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::insert ( typename Base::const_iterator  position,
typename Base::size_type  n,
const typename Base::value_type &  x 
)
inline

Insert a number of copies of given data into the BoundedVector.

This function will insert a specified number of copies of the given data before the location specified by position.

Note that this kind of operation could be expensive for a BoundedVector and if it is frequently used the user should consider using std::list.

Parameters
positionA const_iterator into the BoundedVector
nNumber of elements to be inserted
xData to be inserted
Returns
An iterator that points to the inserted data

◆ insert() [5/5]

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
template<typename InputIterator >
Base::iterator rosidl_runtime_cpp::BoundedVector< Tp, UpperBound, Alloc >::insert ( typename Base::const_iterator  position,
InputIterator  first,
InputIterator  last 
)
inline

Insert a range into the BoundedVector.

This function will insert copies of the data in the range [first,last) into the BoundedVector before the location specified by pos.

Note that this kind of operation could be expensive for a BoundedVector and if it is frequently used the user should consider using std::list.

Parameters
positionA const_iterator into the BoundedVector
firstAn input iterator
lastAn input iterator
Returns
An iterator that points to the inserted data

◆ begin()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::begin

◆ end()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::end

◆ rbegin()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::rbegin

◆ rend()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::rend

◆ cbegin()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::cbegin

◆ cend()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::cend

◆ crbegin()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::crbegin

◆ crend()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::crend

◆ size()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::size

◆ shrink_to_fit()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::shrink_to_fit

◆ capacity()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::capacity

◆ empty()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::empty

◆ at()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::at

◆ front()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::front

◆ back()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::back

◆ erase()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::erase

◆ pop_back()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::pop_back

◆ clear()

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
T std::vector::clear

Friends And Related Function Documentation

◆ operator==

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
bool operator== ( const BoundedVector< Tp, UpperBound, Alloc > &  x,
const BoundedVector< Tp, UpperBound, Alloc > &  y 
)
friend

Vector equality comparison.

This is an equivalence relation. It is linear in the size of the vectors. Vectors are considered equivalent if their sizes are equal, and if corresponding elements compare equal.

Parameters
xA BoundedVector
yA BoundedVector of the same type as x
Returns
True if the size and elements of the vectors are equal

◆ operator<

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
bool operator< ( const BoundedVector< Tp, UpperBound, Alloc > &  x,
const BoundedVector< Tp, UpperBound, Alloc > &  y 
)
friend

Vector ordering relation.

This is a total ordering relation. It is linear in the size of the vectors. The elements must be comparable with <.

See std::lexicographical_compare() for how the determination is made.

Parameters
xA BoundedVector
yA BoundedVector of the same type as x
Returns
True if x is lexicographically less than y

◆ operator!=

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
bool operator!= ( const BoundedVector< Tp, UpperBound, Alloc > &  x,
const BoundedVector< Tp, UpperBound, Alloc > &  y 
)
friend

Based on operator==.

◆ operator>

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
bool operator> ( const BoundedVector< Tp, UpperBound, Alloc > &  x,
const BoundedVector< Tp, UpperBound, Alloc > &  y 
)
friend

Based on operator<.

◆ operator<=

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
bool operator<= ( const BoundedVector< Tp, UpperBound, Alloc > &  x,
const BoundedVector< Tp, UpperBound, Alloc > &  y 
)
friend

Based on operator<.

◆ operator>=

template<typename Tp , std::size_t UpperBound, typename Alloc = std::allocator<Tp>>
bool operator>= ( const BoundedVector< Tp, UpperBound, Alloc > &  x,
const BoundedVector< Tp, UpperBound, Alloc > &  y 
)
friend

Based on operator<.


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