vector class influenced by standard library
More...
#include <object/vector.h>
template<class T>
class vector< T >
vector class influenced by standard library
◆ vector() [1/2]
Constructor.
- Parameters
-
invalid | object for invalid returns |
◆ vector() [2/2]
template<class T >
vector< T >::vector |
( |
size_t |
count, |
|
|
T |
init, |
|
|
T |
invalid = T() |
|
) |
| |
|
inlineexplicit |
Constructor with initial _capacity.
- Parameters
-
count | number of initial values |
init | initial values |
invalid | object for invalid returns |
◆ at()
template<class T >
T& vector< T >::at |
( |
size_t |
pos | ) |
|
|
inline |
access specified element
- Parameters
-
pos | position of the element to return |
- Returns
- element or T() if out of bounds
- Note
- This function differs to the standard library due to the lack of exceptions
◆ front()
Access the first element.
- Returns
- first element or T() if none
◆ back()
Access the last element.
- Returns
- last element or T() if none
◆ data()
direct access to the underlying array
- Returns
- Pointer to data
◆ size()
template<class T >
size_t vector< T >::size |
( |
| ) |
const |
|
inline |
Get the number of elements.
- Returns
- number of entires
◆ capacity()
template<class T >
size_t vector< T >::capacity |
( |
| ) |
const |
|
inline |
Get the number of elements that can be held in currently allocated storage.
- Returns
- current capacity
◆ reserve()
template<class T >
void vector< T >::reserve |
( |
size_t |
capacity | ) |
|
|
inline |
Increase the capacity of the vector.
- Parameters
-
◆ resize() [1/2]
template<class T >
void vector< T >::resize |
( |
size_t |
count, |
|
|
T |
value |
|
) |
| |
|
inline |
Resizes the container.
- Parameters
-
count | new size of the container |
value | the value to initialize the new elements with |
◆ resize() [2/2]
template<class T >
void vector< T >::resize |
( |
size_t |
count | ) |
|
|
inline |
Resizes the container.
- Parameters
-
count | new size of the container |
◆ push_back()
template<class T >
void vector< T >::push_back |
( |
const T & |
value | ) |
|
|
inline |
Adds an element to the end.
- Parameters
-
value | the value of the element to append |
◆ insert()
template<class T >
void vector< T >::insert |
( |
size_t |
pos, |
|
|
const T & |
value |
|
) |
| |
|
inline |
Inserts elements at the specified location.
- Parameters
-
◆ pop_back()
Remove the last element.
- Returns
- last element
◆ remove()
template<class T >
T vector< T >::remove |
( |
size_t |
pos | ) |
|
|
inline |
Remove element at the specified location.
- Parameters
-
- Returns
- value or T() if position out of bounds
◆ operator[]()
template<class T >
T& vector< T >::operator[] |
( |
int |
i | ) |
|
|
inline |
Access Element.
- Parameters
-
◆ operator=()
◆ operator+=() [1/2]
Concatenate vector.
- Parameters
-
- Returns
- reference to vector
◆ operator+=() [2/2]
Concatenate element.
- Parameters
-
- Returns
- reference to vector
◆ operator+() [1/2]
Concatenate two vectors.
- Parameters
-
- Returns
- new vector with all elements of this and other vector
◆ operator+() [2/2]
Concatenate element.
- Parameters
-
element | element to Concatenate |
- Returns
- new vector with all elements of this vector and element
The documentation for this class was generated from the following file: