std::vector<T>-like container that requires specific indexing type, More...
#include <MRVector.h>
Public Types | |
using | value_type = typename std::vector<T>::value_type |
using | reference = typename std::vector<T>::reference |
using | const_reference = typename std::vector<T>::const_reference |
using | iterator = typename std::vector<T>::iterator |
using | const_iterator = typename std::vector<T>::const_iterator |
Public Member Functions | |
Vector ()=default | |
Vector (size_t size) MR_REQUIRES_IF_SUPPORTED(sizeof(T)>0 &&std | |
Vector (size_t size, const T &val) | |
Vector (std::vector< T > &&vec) | |
template<class InputIt > | |
Vector (InputIt first, InputIt last) | |
Vector (std::initializer_list< T > init) | |
bool | operator== (const Vector &b) const MR_REQUIRES_IF_SUPPORTED(sizeof(T)>0 &&std |
bool | operator!= (const Vector &b) const MR_REQUIRES_IF_SUPPORTED(sizeof(T)>0 &&std |
void | clear () |
bool | empty () const |
std::size_t | size () const |
void | resize (size_t newSize) MR_REQUIRES_IF_SUPPORTED(sizeof(T)>0 &&std |
void | resize (size_t newSize, const T &t) MR_REQUIRES_IF_SUPPORTED(sizeof(T)>0 &&std |
void | resizeNoInit (size_t targetSize) MR_REQUIRES_IF_SUPPORTED(sizeof(T)>0 &&std |
std::size_t | capacity () const |
void | reserve (size_t capacity) |
const_reference | operator[] (I i) const |
reference | operator[] (I i) |
void | resizeWithReserve (size_t newSize, const T &value=T()) |
doubles reserved memory until resize(newSize) can be done without reallocation | |
void | autoResizeSet (I pos, size_t len, T val) |
sets elements [pos, pos+len) to given value, adjusting the size of the vector to include new elements | |
void | autoResizeSet (I i, T val) |
reference | autoResizeAt (I i) MR_REQUIRES_IF_SUPPORTED(sizeof(T)>0 &&std |
this accessor automatically adjusts the size of the vector | |
void | push_back (const T &t) |
void | push_back (T &&t) |
void | pop_back () |
template<typename... Args> | |
T & | emplace_back (Args &&... args) |
const_reference | front () const |
reference | front () |
const_reference | back () const |
reference | back () |
I | beginId () const |
returns the identifier of the first element | |
I | backId () const |
returns the identifier of the back() element | |
I | endId () const |
returns backId() + 1 | |
T * | data () |
const T * | data () const |
void | swap (Vector &b) |
size_t | heapBytes () const |
returns the amount of memory this object occupies on heap | |
Public Attributes | |
std::vector< T > | vec_ |
the user can directly manipulate the vector, anyway she cannot break anything | |
std::vector<T>-like container that requires specific indexing type,
T | type of stored elements |
I | type of index (shall be convertible to size_t) |
using MR::Vector< T, I >::const_iterator = typename std::vector<T>::const_iterator |
using MR::Vector< T, I >::const_reference = typename std::vector<T>::const_reference |
using MR::Vector< T, I >::iterator = typename std::vector<T>::iterator |
using MR::Vector< T, I >::reference = typename std::vector<T>::reference |
using MR::Vector< T, I >::value_type = typename std::vector<T>::value_type |
|
default |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inlinenodiscard |
this accessor automatically adjusts the size of the vector
|
inline |
|
inline |
sets elements [pos, pos+len) to given value, adjusting the size of the vector to include new elements
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
returns the identifier of the back() element
|
inlinenodiscard |
returns the identifier of the first element
|
inlinenodiscard |
|
inline |
|
inlinenodiscard |
|
inlinenodiscard |
|
inline |
|
inlinenodiscard |
|
inlinenodiscard |
returns backId() + 1
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
returns the amount of memory this object occupies on heap
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
doubles reserved memory until resize(newSize) can be done without reallocation
|
inlinenodiscard |
|
inline |
std::vector<T> MR::Vector< T, I >::vec_ |
the user can directly manipulate the vector, anyway she cannot break anything