CellModules
std::vector< T > Class Template Reference

A simple vector class template. More...

#include <std.hpp>

Public Member Functions

 vector ()
 Default constructor. More...
 
void push_back (const T &value)
 Adds an element to the end of the vector. More...
 
void pop_back ()
 Removes the last element of the vector. More...
 
size_t size () const
 Returns the number of elements in the vector. More...
 
T & front ()
 Returns a reference to the first element. More...
 
T & back ()
 Returns a reference to the last element. More...
 
bool empty () const
 Checks if the vector is empty. More...
 
void clear ()
 Clears the contents of the vector. More...
 
void resize (size_t newSize)
 Resizes the vector to contain the specified number of elements. More...
 
void reserve (size_t newCapacity)
 Reserves storage for the specified number of elements. More...
 
void erase (iterator position)
 Removes the element at the specified position. More...
 
void insert (iterator position, const T &value)
 Inserts an element at the specified position. More...
 
void swap (vector &other)
 Swaps the contents of the vector with another vector. More...
 
iterator begin ()
 Returns an iterator to the first element. More...
 
iterator end ()
 Returns an iterator to the last element. More...
 

Detailed Description

template<class T>
class std::vector< T >

A simple vector class template.

Template Parameters
TType of elements.

Definition at line 290 of file std.hpp.

Constructor & Destructor Documentation

◆ vector()

template<class T >
std::vector< T >::vector ( )
inline

Default constructor.

Definition at line 295 of file std.hpp.

Member Function Documentation

◆ back()

template<class T >
T & std::vector< T >::back ( )
inline

Returns a reference to the last element.

Returns
Reference to the last element.

Definition at line 338 of file std.hpp.

◆ begin()

template<class T >
iterator std::vector< T >::begin ( )
inline

Returns an iterator to the first element.

Returns
Iterator to the first element.

Definition at line 409 of file std.hpp.

◆ clear()

template<class T >
void std::vector< T >::clear ( )
inline

Clears the contents of the vector.

Definition at line 354 of file std.hpp.

◆ empty()

template<class T >
bool std::vector< T >::empty ( ) const
inline

Checks if the vector is empty.

Returns
True if the vector is empty, false otherwise.

Definition at line 347 of file std.hpp.

◆ end()

template<class T >
iterator std::vector< T >::end ( )
inline

Returns an iterator to the last element.

Returns
Iterator to the last element.

Definition at line 418 of file std.hpp.

◆ erase()

template<class T >
void std::vector< T >::erase ( iterator  position)
inline

Removes the element at the specified position.

Parameters
positionIterator to the element to remove.

Definition at line 381 of file std.hpp.

◆ front()

template<class T >
T & std::vector< T >::front ( )
inline

Returns a reference to the first element.

Returns
Reference to the first element.

Definition at line 329 of file std.hpp.

◆ insert()

template<class T >
void std::vector< T >::insert ( iterator  position,
const T &  value 
)
inline

Inserts an element at the specified position.

Parameters
positionIterator to the position to insert the element.
valueThe value to insert.

Definition at line 391 of file std.hpp.

◆ pop_back()

template<class T >
void std::vector< T >::pop_back ( )
inline

Removes the last element of the vector.

Definition at line 311 of file std.hpp.

◆ push_back()

template<class T >
void std::vector< T >::push_back ( const T &  value)
inline

Adds an element to the end of the vector.

Parameters
valueThe value to add.

Definition at line 304 of file std.hpp.

◆ reserve()

template<class T >
void std::vector< T >::reserve ( size_t  newCapacity)
inline

Reserves storage for the specified number of elements.

Parameters
newCapacityNew capacity of the vector.

Definition at line 372 of file std.hpp.

◆ resize()

template<class T >
void std::vector< T >::resize ( size_t  newSize)
inline

Resizes the vector to contain the specified number of elements.

Parameters
newSizeNew size of the vector.

Definition at line 363 of file std.hpp.

◆ size()

template<class T >
size_t std::vector< T >::size ( ) const
inline

Returns the number of elements in the vector.

Returns
Number of elements in the vector.

Definition at line 320 of file std.hpp.

◆ swap()

template<class T >
void std::vector< T >::swap ( vector< T > &  other)
inline

Swaps the contents of the vector with another vector.

Parameters
otherThe vector to swap with.

Definition at line 400 of file std.hpp.


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