Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Types | Public Member Functions
ext::ptr_vector< T > Class Template Reference

Implementation of vector storing dynamicaly allocated instances of given type. The class mimicks the iterface of the standard library vector, but effectively allows polymorphic objects to be stored inside. More...

#include <ptr_vector.hpp>

Public Types

using value_type = T
 The type of values. More...
 
using size_type = std::size_t
 The type of sizes. More...
 
using diference_type = std::ptrdiff_t
 The type of size differences. More...
 
using reference = value_type &
 The type of reference to values. More...
 
using const_reference = const value_type &
 The type of reference to constant values. More...
 
using pointer = T *
 The type of pointer to values. More...
 
using const_pointer = const T *
 The type of pointer to constant value. More...
 
using iterator = dereferencing_iterator< typename std::vector< T * >::iterator >
 The type of values iterator. More...
 
using const_iterator = dereferencing_iterator< typename std::vector< T * >::const_iterator >
 The type of constant values iterator. More...
 
using reverse_iterator = dereferencing_iterator< typename std::vector< T * >::reverse_iterator >
 The type of reverse values iterator. More...
 
using const_reverse_iterator = dereferencing_iterator< typename std::vector< T * >::const_reverse_iterator >
 The type of constant reverse values iterator. More...
 

Public Member Functions

 ptr_vector () noexcept=default
 The default constructor creating empty vector. More...
 
template<class R >
 ptr_vector (std::initializer_list< R > init)
 The constructor of the vecto from initializer list. The vector will store dynamically allocated copies of objects from inside of the initializer list. More...
 
template<class R = T>
 ptr_vector (size_type count)
 The constructor of the vector of specific size. Elements of the vector are defaultly constructed values of type R. More...
 
template<class InputIt >
 ptr_vector (InputIt first, InputIt last)
 Constructor of the vector from range specified by iterators. More...
 
template<class Iterator >
 ptr_vector (const ext::iterator_range< Iterator > &range)
 
template<class R >
 ptr_vector (size_type count, const R &value)
 Constructor of the vector of size given by count and filled with values from value. More...
 
 ptr_vector (const ptr_vector &other)
 Copy constrctor of the pointer vector. More...
 
 ptr_vector (ptr_vector &&other) noexcept
 Move constrctor of the pointer vector. More...
 
 ~ptr_vector () noexcept
 The destructor of the vector. More...
 
ptr_vector< T > & operator= (const ptr_vector< T > &other)
 The copy operator of assignment. More...
 
ptr_vector< T > & operator= (ptr_vector< T > &&other) noexcept
 The move operator of assignment. More...
 
template<class R >
void assign (size_type count, const R &value)
 Sets the content of the vector to value copied count times. More...
 
template<class InputIt >
void assign (InputIt first, InputIt last)
 Sets the content of the vector to values in the given range. More...
 
template<class R >
void assign (std::initializer_list< R > ilist)
 Sets the content of the vector to values in the initializer list. More...
 
reference at (size_type index)
 Getter of a reference to the value on given index. More...
 
const_reference at (size_type index) const
 Getter of a reference to the value on given index. More...
 
reference operator[] (size_type index)
 Array subscript operator. More...
 
const_reference operator[] (size_type index) const
 Array subscript operator. More...
 
reference front ()
 Getter of a value on the lowest index. More...
 
const_reference front () const
 Getter of a value on the lowest index. More...
 
reference back ()
 Getter of a value on the highest index. More...
 
const_reference back () const
 Getter of a value on the highest index. More...
 
iterator begin () &noexcept
 Iterator to the begining of the values range in the vector. More...
 
const_iterator begin () const &noexcept
 Const iterator to the begining of the values range in the vector. More...
 
auto begin () &&noexcept
 Move iterator to the begining of the values range in the vector. More...
 
const_iterator cbegin () const noexcept
 Iterator to the begining of the values range in the vector. More...
 
iterator end () &noexcept
 Iterator one past the last element of the values range in the vector. More...
 
const_iterator end () const &noexcept
 Const iterator one past the last element of the values range in the vector. More...
 
auto end () &&noexcept
 Move iterator to the begining of the values range in the vector. More...
 
const_iterator cend () const noexcept
 Iterator one past the last element of the values range in the vector. More...
 
reverse_iterator rbegin () noexcept
 Reverse iterator to the begining of the reversed range of values in the vector. More...
 
const_reverse_iterator rbegin () const noexcept
 Reverse iterator to the begining of the reversed range of values in the vector. More...
 
const_reverse_iterator crbegin () const noexcept
 Reverse iterator to the begining of the reversed range of values in the vector. More...
 
reverse_iterator rend () noexcept
 Reverse iterator one past the last element of the reversed range of values in the vector. More...
 
const_reverse_iterator rend () const noexcept
 Reverse iterator one past the last element of the reversed range of values in the vector. More...
 
const_reverse_iterator crend () const noexcept
 Reverse iterator one past the last element of the reversed range of values in the vector. More...
 
auto range () &
 Make range of non-const begin to end iterators. More...
 
auto range () const &
 Make range of non-const begin to end iterators. More...
 
auto range () &&
 Make range of move begin to end iterators. More...
 
bool empty () const noexcept
 Array emptines test. More...
 
size_type size () const noexcept
 Getter of the vector size. More...
 
size_type max_size () const noexcept
 Returns the maximal number of values possible to store inside the container. More...
 
void reserve (size_type new_cap)
 Prealocates space for given number of elements. Does not shrink the vector. More...
 
size_type capacity () const noexcept
 Returns the preallocated size of the vector. More...
 
void shrink_to_fit ()
 Reallocates the vector to have the miniaml space overhead. More...
 
void clear () noexcept
 Removes all values from the vector. More...
 
template<class R >
iterator set (iterator pos, R &&value)
 Changes the value on position given by iterator pos. More...
 
template<class R >
iterator set (const_iterator pos, R &&value)
 Changes the value on position given by iterator pos. More...
 
template<class R >
reverse_iterator set (reverse_iterator pos, R &&value)
 Changes the value on position given by iterator pos. More...
 
template<class R >
reverse_iterator set (const_reverse_iterator pos, R &&value)
 Changes the value on position given by iterator pos. More...
 
template<class R = T, class ... Args>
iterator emplace_set (iterator pos, Args &&... args)
 Changes the value on position given by iterator pos. More...
 
template<class R = T, class ... Args>
iterator emplace_set (const_iterator pos, Args &&... args)
 Changes the value on position given by iterator pos. More...
 
template<class R = T, class ... Args>
reverse_iterator emplace_set (reverse_iterator pos, Args &&... args)
 Changes the value on position given by iterator pos. More...
 
template<class R = T, class ... Args>
reverse_iterator emplace_set (const_reverse_iterator pos, Args &&... args)
 Changes the value on position given by iterator pos. More...
 
template<class R >
iterator insert (iterator pos, R &&value)
 Inserts the value on position given by iterator pos. More...
 
template<class R >
iterator insert (const_iterator pos, R &&value)
 Inserts the value on position given by iterator pos. More...
 
template<class R >
reverse_iterator insert (reverse_iterator pos, R &&value)
 Inserts the value on position given by iterator pos. More...
 
template<class R >
reverse_iterator insert (const_reverse_iterator pos, R &&value)
 Inserts the value on position given by iterator pos. More...
 
template<class R >
iterator insert (iterator pos, size_type count, const R &value)
 Inserts the count copies of value on position given by iterator pos. More...
 
template<class R >
iterator insert (const_iterator pos, size_type count, const R &value)
 Inserts the count copies of value on position given by iterator pos. More...
 
template<class R >
reverse_iterator insert (reverse_iterator pos, size_type count, const R &value)
 Inserts the count copies of value on position given by iterator pos. More...
 
template<class R >
reverse_iterator insert (const_reverse_iterator pos, size_type count, const R &value)
 Inserts the count copies of value on position given by iterator pos. More...
 
template<class InputIt >
iterator insert (iterator pos, InputIt first, InputIt last)
 Inserts the values from the given range to positions starting at given iterator pos. More...
 
template<class InputIt >
iterator insert (const_iterator pos, InputIt first, InputIt last)
 Inserts the values from the given range to positions starting at given iterator pos. More...
 
template<class InputIt >
reverse_iterator insert (reverse_iterator pos, InputIt first, InputIt last)
 Inserts the values from the given range to positions starting at given iterator pos. More...
 
template<class InputIt >
reverse_iterator insert (const_reverse_iterator pos, InputIt first, InputIt last)
 Inserts the values from the given range to positions starting at given iterator pos. More...
 
template<class R >
iterator insert (iterator pos, std::initializer_list< R > ilist)
 Inserts the values from the given initializer list to positions starting at given iterator pos. More...
 
template<class R >
iterator insert (const_iterator pos, std::initializer_list< R > ilist)
 Inserts the values from the given initializer list to positions starting at given iterator pos. More...
 
template<class R >
reverse_iterator insert (reverse_iterator pos, std::initializer_list< R > ilist)
 Inserts the values from the given initializer list to positions starting at given iterator pos. More...
 
template<class R >
reverse_iterator insert (const_reverse_iterator pos, std::initializer_list< R > ilist)
 Inserts the values from the given initializer list to positions starting at given iterator pos. More...
 
template<class R = T, class ... Args>
iterator emplace (iterator pos, Args &&... args)
 Inserts a new value to the container at position given by parameter pos. The new value is constructed inside the method from constructor parameters. More...
 
template<class R = T, class ... Args>
iterator emplace (const_iterator pos, Args &&... args)
 Inserts a new value to the container at position given by parameter pos. The new value is constructed inside the method from constructor parameters. More...
 
template<class R = T, class ... Args>
reverse_iterator emplace (reverse_iterator pos, Args &&... args)
 Inserts a new value to the container at position given by parameter pos. The new value is constructed inside the method from constructor parameters. More...
 
template<class R = T, class ... Args>
reverse_iterator emplace (const_reverse_iterator pos, Args &&... args)
 Inserts a new value to the container at position given by parameter pos. The new value is constructed inside the method from constructor parameters. More...
 
iterator erase (iterator pos)
 Removes element from the container at position given by parameter pos. More...
 
iterator erase (const_iterator pos)
 Removes element from the container at position given by parameter pos. More...
 
reverse_iterator erase (reverse_iterator pos)
 Removes element from the container at position given by parameter pos. More...
 
reverse_iterator erase (const_reverse_iterator pos)
 Removes element from the container at position given by parameter pos. More...
 
iterator erase (iterator first, iterator last)
 Removes elements from the container in range given parameters first and last. More...
 
iterator erase (const_iterator first, const_iterator last)
 Removes elements from the container in range given parameters first and last. More...
 
reverse_iterator erase (reverse_iterator first, reverse_iterator last)
 Removes elements from the container in range given parameters first and last. More...
 
reverse_iterator erase (const_reverse_iterator first, const_reverse_iterator last)
 Removes elements from the container in range given parameters first and last. More...
 
template<class R >
void push_back (R &&value)
 Appends a new value at the end of the container. More...
 
template<class R = T, class ... Args>
reference emplace_back (Args &&... args)
 Appends a new value at the end of the container. The value is constructed inside the method using provided constructor parameters. More...
 
void pop_back ()
 Removes element from the end of the container. More...
 
template<class R = T>
void resize (size_type count)
 Changes the size of the vector, allocates new elements if the size increases. The possibly needed values are defaultly constructed values of type R. The vector can both increase or decrease in size. More...
 
template<class R >
void resize (size_type count, const R &value)
 Changes the size of the vector. If the container increases in size copies of the value are used at new positions. More...
 
void shrink (size_type count)
 Like resize but only shrinks the container. If the requested size of the vector is bigger than actual size, nothing happens. More...
 
void swap (ptr_vector &other)
 Swaps two instances of pointer vector. More...
 
auto operator<=> (const ext::ptr_vector< T > &second) const
 
bool operator== (const ptr_vector< T > &second) const
 Specialisation of equality operator for pointer vector. More...
 

Detailed Description

template<class T>
class ext::ptr_vector< T >

Implementation of vector storing dynamicaly allocated instances of given type. The class mimicks the iterface of the standard library vector, but effectively allows polymorphic objects to be stored inside.

Template Parameters
Tthe type of stored values
Nthe size of the vector

Member Typedef Documentation

◆ const_iterator

template<class T >
using ext::ptr_vector< T >::const_iterator = dereferencing_iterator < typename std::vector < T * >::const_iterator >

The type of constant values iterator.

◆ const_pointer

template<class T >
using ext::ptr_vector< T >::const_pointer = const T *

The type of pointer to constant value.

◆ const_reference

template<class T >
using ext::ptr_vector< T >::const_reference = const value_type &

The type of reference to constant values.

◆ const_reverse_iterator

template<class T >
using ext::ptr_vector< T >::const_reverse_iterator = dereferencing_iterator < typename std::vector < T * >::const_reverse_iterator >

The type of constant reverse values iterator.

◆ diference_type

template<class T >
using ext::ptr_vector< T >::diference_type = std::ptrdiff_t

The type of size differences.

◆ iterator

template<class T >
using ext::ptr_vector< T >::iterator = dereferencing_iterator < typename std::vector < T * >::iterator >

The type of values iterator.

◆ pointer

template<class T >
using ext::ptr_vector< T >::pointer = T *

The type of pointer to values.

◆ reference

template<class T >
using ext::ptr_vector< T >::reference = value_type &

The type of reference to values.

◆ reverse_iterator

template<class T >
using ext::ptr_vector< T >::reverse_iterator = dereferencing_iterator < typename std::vector < T * >::reverse_iterator >

The type of reverse values iterator.

◆ size_type

template<class T >
using ext::ptr_vector< T >::size_type = std::size_t

The type of sizes.

◆ value_type

template<class T >
using ext::ptr_vector< T >::value_type = T

The type of values.

Constructor & Destructor Documentation

◆ ptr_vector() [1/8]

template<class T >
ext::ptr_vector< T >::ptr_vector ( )
defaultnoexcept

The default constructor creating empty vector.

◆ ptr_vector() [2/8]

template<class T >
template<class R >
ext::ptr_vector< T >::ptr_vector ( std::initializer_list< R >  init)
inline

The constructor of the vecto from initializer list. The vector will store dynamically allocated copies of objects from inside of the initializer list.

Template Parameters
Rthe types stored inside the initializer list
Parameters
initthe initializer list
Here is the call graph for this function:

◆ ptr_vector() [3/8]

template<class T >
template<class R = T>
ext::ptr_vector< T >::ptr_vector ( size_type  count)
inlineexplicit

The constructor of the vector of specific size. Elements of the vector are defaultly constructed values of type R.

Template Parameters
Rthe actual type of values inside the constructed vector.
Parameters
countthe size of the constructed vector

◆ ptr_vector() [4/8]

template<class T >
template<class InputIt >
ext::ptr_vector< T >::ptr_vector ( InputIt  first,
InputIt  last 
)
inline

Constructor of the vector from range specified by iterators.

Template Parameters
InputItthe iterator type
Parameters
firstthe begining of the range
lastthe end of the range
Here is the call graph for this function:

◆ ptr_vector() [5/8]

template<class T >
template<class Iterator >
ext::ptr_vector< T >::ptr_vector ( const ext::iterator_range< Iterator > &  range)
inline

Constructor from range of values.

Template Parameters
Iteratorthe type of range iterator
Parameters
rangethe source range

◆ ptr_vector() [6/8]

template<class T >
template<class R >
ext::ptr_vector< T >::ptr_vector ( size_type  count,
const R &  value 
)
inline

Constructor of the vector of size given by count and filled with values from value.

Template Parameters
Rthe actual type of value to fill with
Parameters
countthe size of the vector
valuethe value to fill the vector with
Here is the call graph for this function:

◆ ptr_vector() [7/8]

template<class T >
ext::ptr_vector< T >::ptr_vector ( const ptr_vector< T > &  other)
inline

Copy constrctor of the pointer vector.

Parameters
otherthe other instance
Here is the call graph for this function:

◆ ptr_vector() [8/8]

template<class T >
ext::ptr_vector< T >::ptr_vector ( ptr_vector< T > &&  other)
inlinenoexcept

Move constrctor of the pointer vector.

Parameters
otherthe other instance
Here is the call graph for this function:

◆ ~ptr_vector()

template<class T >
ext::ptr_vector< T >::~ptr_vector ( )
inlinenoexcept

The destructor of the vector.

Here is the call graph for this function:

Member Function Documentation

◆ assign() [1/3]

template<class T >
template<class InputIt >
void ext::ptr_vector< T >::assign ( InputIt  first,
InputIt  last 
)
inline

Sets the content of the vector to values in the given range.

Template Parameters
InputItthe iterator type
Parameters
firstthe begining of the range
lastthe end of the range
Here is the call graph for this function:

◆ assign() [2/3]

template<class T >
template<class R >
void ext::ptr_vector< T >::assign ( size_type  count,
const R &  value 
)
inline

Sets the content of the vector to value copied count times.

Template Parameters
Rthe actual type of value to fill with
Parameters
countthe number how many time copy the value
thevalue to fill the container with
Here is the call graph for this function:
Here is the caller graph for this function:

◆ assign() [3/3]

template<class T >
template<class R >
void ext::ptr_vector< T >::assign ( std::initializer_list< R >  ilist)
inline

Sets the content of the vector to values in the initializer list.

Template Parameters
Rthe types stored inside the initializer list
Parameters
ilistthe initializer list
Here is the call graph for this function:

◆ at() [1/2]

template<class T >
reference ext::ptr_vector< T >::at ( size_type  index)
inline

Getter of a reference to the value on given index.

Parameters
indexthe index to retrieve
Returns
reference to a value at given index

◆ at() [2/2]

template<class T >
const_reference ext::ptr_vector< T >::at ( size_type  index) const
inline

Getter of a reference to the value on given index.

Parameters
indexthe index to retrieve
Returns
reference to a value at given index

◆ back() [1/2]

template<class T >
reference ext::ptr_vector< T >::back ( )
inline

Getter of a value on the highest index.

Returns
reference to a value on the highest index

◆ back() [2/2]

template<class T >
const_reference ext::ptr_vector< T >::back ( ) const
inline

Getter of a value on the highest index.

Returns
reference to a value on the highest index

◆ begin() [1/3]

template<class T >
auto ext::ptr_vector< T >::begin ( ) &&
inlinenoexcept

Move iterator to the begining of the values range in the vector.

Returns
move iterator to the begining
Here is the call graph for this function:

◆ begin() [2/3]

template<class T >
iterator ext::ptr_vector< T >::begin ( ) &
inlinenoexcept

Iterator to the begining of the values range in the vector.

Returns
iterator to the begining
Here is the call graph for this function:
Here is the caller graph for this function:

◆ begin() [3/3]

template<class T >
const_iterator ext::ptr_vector< T >::begin ( ) const &
inlinenoexcept

Const iterator to the begining of the values range in the vector.

Returns
iterator to the begining
Here is the call graph for this function:

◆ capacity()

template<class T >
size_type ext::ptr_vector< T >::capacity ( ) const
inlinenoexcept

Returns the preallocated size of the vector.

Returns
the preallocated size of the vector

◆ cbegin()

template<class T >
const_iterator ext::ptr_vector< T >::cbegin ( ) const
inlinenoexcept

Iterator to the begining of the values range in the vector.

Returns
iterator to the begining
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cend()

template<class T >
const_iterator ext::ptr_vector< T >::cend ( ) const
inlinenoexcept

Iterator one past the last element of the values range in the vector.

Returns
iterator to the end
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

template<class T >
void ext::ptr_vector< T >::clear ( )
inlinenoexcept

Removes all values from the vector.

Here is the caller graph for this function:

◆ crbegin()

template<class T >
const_reverse_iterator ext::ptr_vector< T >::crbegin ( ) const
inlinenoexcept

Reverse iterator to the begining of the reversed range of values in the vector.

Returns
reverse iterator to the begining
Here is the call graph for this function:
Here is the caller graph for this function:

◆ crend()

template<class T >
const_reverse_iterator ext::ptr_vector< T >::crend ( ) const
inlinenoexcept

Reverse iterator one past the last element of the reversed range of values in the vector.

Returns
reverse iterator to the end
Here is the call graph for this function:

◆ emplace() [1/4]

template<class T >
template<class R = T, class ... Args>
iterator ext::ptr_vector< T >::emplace ( const_iterator  pos,
Args &&...  args 
)
inline

Inserts a new value to the container at position given by parameter pos. The new value is constructed inside the method from constructor parameters.

Template Parameters
Rthe actual type of value stored inside the vector
Args... the types of arguments of the R constructor
Parameters
posthe position to set
args... the arguments of the R constructor
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ emplace() [2/4]

template<class T >
template<class R = T, class ... Args>
reverse_iterator ext::ptr_vector< T >::emplace ( const_reverse_iterator  pos,
Args &&...  args 
)
inline

Inserts a new value to the container at position given by parameter pos. The new value is constructed inside the method from constructor parameters.

Template Parameters
Rthe actual type of value stored inside the vector
Args... the types of arguments of the R constructor
Parameters
posthe position to set
args... the arguments of the R constructor
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ emplace() [3/4]

template<class T >
template<class R = T, class ... Args>
iterator ext::ptr_vector< T >::emplace ( iterator  pos,
Args &&...  args 
)
inline

Inserts a new value to the container at position given by parameter pos. The new value is constructed inside the method from constructor parameters.

Template Parameters
Rthe actual type of value stored inside the vector
Args... the types of arguments of the R constructor
Parameters
posthe position to set
args... the arguments of the R constructor
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ emplace() [4/4]

template<class T >
template<class R = T, class ... Args>
reverse_iterator ext::ptr_vector< T >::emplace ( reverse_iterator  pos,
Args &&...  args 
)
inline

Inserts a new value to the container at position given by parameter pos. The new value is constructed inside the method from constructor parameters.

Template Parameters
Rthe actual type of value stored inside the vector
Args... the types of arguments of the R constructor
Parameters
posthe position to set
args... the arguments of the R constructor
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ emplace_back()

template<class T >
template<class R = T, class ... Args>
reference ext::ptr_vector< T >::emplace_back ( Args &&...  args)
inline

Appends a new value at the end of the container. The value is constructed inside the method using provided constructor parameters.

Template Parameters
Rthe actual type of appended value
Args... the types of arguments of the R constructor
Parameters
posthe position to set
args... the arguments of the R constructor
Returns
reference to the emplaced value
Here is the call graph for this function:

◆ emplace_set() [1/4]

template<class T >
template<class R = T, class ... Args>
iterator ext::ptr_vector< T >::emplace_set ( const_iterator  pos,
Args &&...  args 
)
inline

Changes the value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Args... the types of arguments of the R constructor
Parameters
posthe position to set
args... the arguments of the R constructor
Returns
updated iterator to the changed location
Here is the call graph for this function:

◆ emplace_set() [2/4]

template<class T >
template<class R = T, class ... Args>
reverse_iterator ext::ptr_vector< T >::emplace_set ( const_reverse_iterator  pos,
Args &&...  args 
)
inline

Changes the value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Args... the types of arguments of the R constructor
Parameters
posthe position to set
args... the arguments of the R constructor
Returns
updated iterator to the changed location
Here is the call graph for this function:

◆ emplace_set() [3/4]

template<class T >
template<class R = T, class ... Args>
iterator ext::ptr_vector< T >::emplace_set ( iterator  pos,
Args &&...  args 
)
inline

Changes the value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Args... the types of arguments of the R constructor
Parameters
posthe position to set
args... the arguments of the R constructor
Returns
updated iterator to the changed location
Here is the call graph for this function:
Here is the caller graph for this function:

◆ emplace_set() [4/4]

template<class T >
template<class R = T, class ... Args>
reverse_iterator ext::ptr_vector< T >::emplace_set ( reverse_iterator  pos,
Args &&...  args 
)
inline

Changes the value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Args... the types of arguments of the R constructor
Parameters
posthe position to set
args... the arguments of the R constructor
Returns
updated iterator to the changed location
Here is the call graph for this function:

◆ empty()

template<class T >
bool ext::ptr_vector< T >::empty ( ) const
inlinenoexcept

Array emptines test.

Returns
true it vector is empty, false othervise

◆ end() [1/3]

template<class T >
auto ext::ptr_vector< T >::end ( ) &&
inlinenoexcept

Move iterator to the begining of the values range in the vector.

Returns
iterator to the begining
Here is the call graph for this function:

◆ end() [2/3]

template<class T >
iterator ext::ptr_vector< T >::end ( ) &
inlinenoexcept

Iterator one past the last element of the values range in the vector.

Returns
iterator to the end
Here is the call graph for this function:
Here is the caller graph for this function:

◆ end() [3/3]

template<class T >
const_iterator ext::ptr_vector< T >::end ( ) const &
inlinenoexcept

Const iterator one past the last element of the values range in the vector.

Returns
iterator to the end
Here is the call graph for this function:

◆ erase() [1/8]

template<class T >
iterator ext::ptr_vector< T >::erase ( const_iterator  first,
const_iterator  last 
)
inline

Removes elements from the container in range given parameters first and last.

Parameters
firstthe begining of the removed range
lastthe end of the removed range
Returns
updated iterator to value after the removed ones
Here is the call graph for this function:

◆ erase() [2/8]

template<class T >
iterator ext::ptr_vector< T >::erase ( const_iterator  pos)
inline

Removes element from the container at position given by parameter pos.

Parameters
posthe iterator pointing to the value to removed
Returns
updated iterator to value after the removed one
Here is the call graph for this function:

◆ erase() [3/8]

template<class T >
reverse_iterator ext::ptr_vector< T >::erase ( const_reverse_iterator  first,
const_reverse_iterator  last 
)
inline

Removes elements from the container in range given parameters first and last.

Parameters
firstthe begining of the removed range
lastthe end of the removed range
Returns
updated iterator to value after the removed ones
Here is the call graph for this function:

◆ erase() [4/8]

template<class T >
reverse_iterator ext::ptr_vector< T >::erase ( const_reverse_iterator  pos)
inline

Removes element from the container at position given by parameter pos.

Parameters
posthe iterator pointing to the value to removed
Returns
updated iterator to value after the removed one
Here is the call graph for this function:

◆ erase() [5/8]

template<class T >
iterator ext::ptr_vector< T >::erase ( iterator  first,
iterator  last 
)
inline

Removes elements from the container in range given parameters first and last.

Parameters
firstthe begining of the removed range
lastthe end of the removed range
Returns
updated iterator to value after the removed ones
Here is the call graph for this function:

◆ erase() [6/8]

template<class T >
iterator ext::ptr_vector< T >::erase ( iterator  pos)
inline

Removes element from the container at position given by parameter pos.

Parameters
posthe iterator pointing to the value to removed
Returns
updated iterator to value after the removed one
Here is the call graph for this function:
Here is the caller graph for this function:

◆ erase() [7/8]

template<class T >
reverse_iterator ext::ptr_vector< T >::erase ( reverse_iterator  first,
reverse_iterator  last 
)
inline

Removes elements from the container in range given parameters first and last.

Parameters
firstthe begining of the removed range
lastthe end of the removed range
Returns
updated iterator to value after the removed ones
Here is the call graph for this function:

◆ erase() [8/8]

template<class T >
reverse_iterator ext::ptr_vector< T >::erase ( reverse_iterator  pos)
inline

Removes element from the container at position given by parameter pos.

Parameters
posthe iterator pointing to the value to removed
Returns
updated iterator to value after the removed one
Here is the call graph for this function:

◆ front() [1/2]

template<class T >
reference ext::ptr_vector< T >::front ( )
inline

Getter of a value on the lowest index.

Returns
reference to a value on the lowest index

◆ front() [2/2]

template<class T >
const_reference ext::ptr_vector< T >::front ( ) const
inline

Getter of a value on the lowest index.

Returns
reference to a value on the lowest index

◆ insert() [1/16]

template<class T >
template<class InputIt >
iterator ext::ptr_vector< T >::insert ( const_iterator  pos,
InputIt  first,
InputIt  last 
)
inline

Inserts the values from the given range to positions starting at given iterator pos.

Template Parameters
InputItthe iterator type
Parameters
firstthe begining of the range
lastthe end of the range
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ insert() [2/16]

template<class T >
template<class R >
iterator ext::ptr_vector< T >::insert ( const_iterator  pos,
R &&  value 
)
inline

Inserts the value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Parameters
posthe position to insert at
valuethe value to insert
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ insert() [3/16]

template<class T >
template<class R >
iterator ext::ptr_vector< T >::insert ( const_iterator  pos,
size_type  count,
const R &  value 
)
inline

Inserts the count copies of value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Parameters
posthe position to insert at
countthe number of copies to insert
valuethe value to insert
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ insert() [4/16]

template<class T >
template<class R >
iterator ext::ptr_vector< T >::insert ( const_iterator  pos,
std::initializer_list< R >  ilist 
)
inline

Inserts the values from the given initializer list to positions starting at given iterator pos.

Template Parameters
Rthe types stored inside the initializer list
Parameters
posthe position to insert at
ilistthe initializer list
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ insert() [5/16]

template<class T >
template<class InputIt >
reverse_iterator ext::ptr_vector< T >::insert ( const_reverse_iterator  pos,
InputIt  first,
InputIt  last 
)
inline

Inserts the values from the given range to positions starting at given iterator pos.

Template Parameters
InputItthe iterator type
Parameters
firstthe begining of the range
lastthe end of the range
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ insert() [6/16]

template<class T >
template<class R >
reverse_iterator ext::ptr_vector< T >::insert ( const_reverse_iterator  pos,
R &&  value 
)
inline

Inserts the value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Parameters
posthe position to insert at
valuethe value to insert
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ insert() [7/16]

template<class T >
template<class R >
reverse_iterator ext::ptr_vector< T >::insert ( const_reverse_iterator  pos,
size_type  count,
const R &  value 
)
inline

Inserts the count copies of value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Parameters
posthe position to insert at
countthe number of copies to insert
valuethe value to insert
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ insert() [8/16]

template<class T >
template<class R >
reverse_iterator ext::ptr_vector< T >::insert ( const_reverse_iterator  pos,
std::initializer_list< R >  ilist 
)
inline

Inserts the values from the given initializer list to positions starting at given iterator pos.

Template Parameters
Rthe types stored inside the initializer list
Parameters
posthe position to insert at
ilistthe initializer list
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ insert() [9/16]

template<class T >
template<class InputIt >
iterator ext::ptr_vector< T >::insert ( iterator  pos,
InputIt  first,
InputIt  last 
)
inline

Inserts the values from the given range to positions starting at given iterator pos.

Template Parameters
InputItthe iterator type
Parameters
firstthe begining of the range
lastthe end of the range
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ insert() [10/16]

template<class T >
template<class R >
iterator ext::ptr_vector< T >::insert ( iterator  pos,
R &&  value 
)
inline

Inserts the value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Parameters
posthe position to insert at
valuethe value to insert
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ insert() [11/16]

template<class T >
template<class R >
iterator ext::ptr_vector< T >::insert ( iterator  pos,
size_type  count,
const R &  value 
)
inline

Inserts the count copies of value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Parameters
posthe position to insert at
countthe number of copies to insert
valuethe value to insert
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ insert() [12/16]

template<class T >
template<class R >
iterator ext::ptr_vector< T >::insert ( iterator  pos,
std::initializer_list< R >  ilist 
)
inline

Inserts the values from the given initializer list to positions starting at given iterator pos.

Template Parameters
Rthe types stored inside the initializer list
Parameters
posthe position to insert at
ilistthe initializer list
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ insert() [13/16]

template<class T >
template<class InputIt >
reverse_iterator ext::ptr_vector< T >::insert ( reverse_iterator  pos,
InputIt  first,
InputIt  last 
)
inline

Inserts the values from the given range to positions starting at given iterator pos.

Template Parameters
InputItthe iterator type
Parameters
firstthe begining of the range
lastthe end of the range
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ insert() [14/16]

template<class T >
template<class R >
reverse_iterator ext::ptr_vector< T >::insert ( reverse_iterator  pos,
R &&  value 
)
inline

Inserts the value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Parameters
posthe position to insert at
valuethe value to insert
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ insert() [15/16]

template<class T >
template<class R >
reverse_iterator ext::ptr_vector< T >::insert ( reverse_iterator  pos,
size_type  count,
const R &  value 
)
inline

Inserts the count copies of value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Parameters
posthe position to insert at
countthe number of copies to insert
valuethe value to insert
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ insert() [16/16]

template<class T >
template<class R >
reverse_iterator ext::ptr_vector< T >::insert ( reverse_iterator  pos,
std::initializer_list< R >  ilist 
)
inline

Inserts the values from the given initializer list to positions starting at given iterator pos.

Template Parameters
Rthe types stored inside the initializer list
Parameters
posthe position to insert at
ilistthe initializer list
Returns
updated iterator to the newly inserted value
Here is the call graph for this function:

◆ max_size()

template<class T >
size_type ext::ptr_vector< T >::max_size ( ) const
inlinenoexcept

Returns the maximal number of values possible to store inside the container.

Returns
the maximal number of values

◆ operator<=>()

template<class T >
auto ext::ptr_vector< T >::operator<=> ( const ext::ptr_vector< T > &  second) const
inline
Here is the call graph for this function:

◆ operator=() [1/2]

template<class T >
ptr_vector< T > & ext::ptr_vector< T >::operator= ( const ptr_vector< T > &  other)
inline

The copy operator of assignment.

Parameters
otherthe other instance
Here is the call graph for this function:

◆ operator=() [2/2]

template<class T >
ptr_vector< T > & ext::ptr_vector< T >::operator= ( ptr_vector< T > &&  other)
inlinenoexcept

The move operator of assignment.

Parameters
otherthe other instance
Here is the call graph for this function:

◆ operator==()

template<class T >
bool ext::ptr_vector< T >::operator== ( const ptr_vector< T > &  second) const
inline

Specialisation of equality operator for pointer vector.

Template Parameters
Tthe type of values inside the vector
Parameters
firstthe first compared value
secondthe second compared value
Returns
true if compared values are the same, false othervise
Here is the call graph for this function:

◆ operator[]() [1/2]

template<class T >
reference ext::ptr_vector< T >::operator[] ( size_type  index)
inline

Array subscript operator.

Parameters
indexthe index to retrieve
Returns
reference to a value at given index

◆ operator[]() [2/2]

template<class T >
const_reference ext::ptr_vector< T >::operator[] ( size_type  index) const
inline

Array subscript operator.

Parameters
indexthe index to retrieve
Returns
reference to a value at given index

◆ pop_back()

template<class T >
void ext::ptr_vector< T >::pop_back ( )
inline

Removes element from the end of the container.

◆ push_back()

template<class T >
template<class R >
void ext::ptr_vector< T >::push_back ( R &&  value)
inline

Appends a new value at the end of the container.

Template Parameters
Rthe actual type of appended value
Parameters
valuethe appended value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ range() [1/3]

template<class T >
auto ext::ptr_vector< T >::range ( ) &
inline

Make range of non-const begin to end iterators.

Returns
full range over container values
Here is the call graph for this function:

◆ range() [2/3]

template<class T >
auto ext::ptr_vector< T >::range ( ) &&
inline

Make range of move begin to end iterators.

Returns
full range over container values

◆ range() [3/3]

template<class T >
auto ext::ptr_vector< T >::range ( ) const &
inline

Make range of non-const begin to end iterators.

Returns
full range over container values
Here is the call graph for this function:

◆ rbegin() [1/2]

template<class T >
const_reverse_iterator ext::ptr_vector< T >::rbegin ( ) const
inlinenoexcept

Reverse iterator to the begining of the reversed range of values in the vector.

Returns
reverse iterator to the begining
Here is the call graph for this function:

◆ rbegin() [2/2]

template<class T >
reverse_iterator ext::ptr_vector< T >::rbegin ( )
inlinenoexcept

Reverse iterator to the begining of the reversed range of values in the vector.

Returns
reverse iterator to the begining
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rend() [1/2]

template<class T >
const_reverse_iterator ext::ptr_vector< T >::rend ( ) const
inlinenoexcept

Reverse iterator one past the last element of the reversed range of values in the vector.

Returns
reverse iterator to the end
Here is the call graph for this function:

◆ rend() [2/2]

template<class T >
reverse_iterator ext::ptr_vector< T >::rend ( )
inlinenoexcept

Reverse iterator one past the last element of the reversed range of values in the vector.

Returns
reverse iterator to the end
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reserve()

template<class T >
void ext::ptr_vector< T >::reserve ( size_type  new_cap)
inline

Prealocates space for given number of elements. Does not shrink the vector.

Parameters
new_capthe preallocated size of the vector

◆ resize() [1/2]

template<class T >
template<class R = T>
void ext::ptr_vector< T >::resize ( size_type  count)
inline

Changes the size of the vector, allocates new elements if the size increases. The possibly needed values are defaultly constructed values of type R. The vector can both increase or decrease in size.

Template Parameters
Rthe type of the constructed values at possibly new indexes
Parameters
countthe requested new size of the vector

◆ resize() [2/2]

template<class T >
template<class R >
void ext::ptr_vector< T >::resize ( size_type  count,
const R &  value 
)
inline

Changes the size of the vector. If the container increases in size copies of the value are used at new positions.

Template Parameters
Rthe actual type of the default value of new positions
Parameters
countthe requested new size of the vector
valuethe fill value of new positions
Here is the call graph for this function:

◆ set() [1/4]

template<class T >
template<class R >
iterator ext::ptr_vector< T >::set ( const_iterator  pos,
R &&  value 
)
inline

Changes the value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Parameters
posthe position to set
valuethe value to place to that position
Returns
updated iterator to the changed location
Here is the call graph for this function:

◆ set() [2/4]

template<class T >
template<class R >
reverse_iterator ext::ptr_vector< T >::set ( const_reverse_iterator  pos,
R &&  value 
)
inline

Changes the value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Parameters
posthe position to set
valuethe value to place to that position
Returns
updated iterator to the changed location
Here is the call graph for this function:

◆ set() [3/4]

template<class T >
template<class R >
iterator ext::ptr_vector< T >::set ( iterator  pos,
R &&  value 
)
inline

Changes the value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Parameters
posthe position to set
valuethe value to place to that position
Returns
updated iterator to the changed location
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set() [4/4]

template<class T >
template<class R >
reverse_iterator ext::ptr_vector< T >::set ( reverse_iterator  pos,
R &&  value 
)
inline

Changes the value on position given by iterator pos.

Template Parameters
Rthe actual type of value stored inside the vector
Parameters
posthe position to set
valuethe value to place to that position
Returns
updated iterator to the changed location
Here is the call graph for this function:

◆ shrink()

template<class T >
void ext::ptr_vector< T >::shrink ( size_type  count)
inline

Like resize but only shrinks the container. If the requested size of the vector is bigger than actual size, nothing happens.

Parameters
countthe requested new size of the vector
Here is the call graph for this function:

◆ shrink_to_fit()

template<class T >
void ext::ptr_vector< T >::shrink_to_fit ( )
inline

Reallocates the vector to have the miniaml space overhead.

◆ size()

template<class T >
size_type ext::ptr_vector< T >::size ( ) const
inlinenoexcept

Getter of the vector size.

Returns
the size of the vector
Here is the caller graph for this function:

◆ swap()

template<class T >
void ext::ptr_vector< T >::swap ( ptr_vector< T > &  other)
inline

Swaps two instances of pointer vector.

Parameters
xthe other instance to swap with
Here is the call graph for this function:

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