NkEnvVector
Generic dynamic vector container (without the STL)
#include "NKPlatform/NkEnv.h"nkentseu::envnkentseudependson(["NKPlatform"])template <typename T> class NkEnvVectorHierarchy
Base classes : none. Derived classes : none.
Members · 22
NkEnvVector | Default constructor (empty vector) |
NkEnvVector | Copy constructor |
NkEnvVector | Move constructor |
~NkEnvVector | Destructor (frees the memory and destroys the elements) |
operator= | Copy assignment operator |
operator= | Move assignment operator |
PushBack | Appends an element at the end by copy |
PushBack | Appends an element at the end by move |
PopBack | Removes the last element (destroys it) |
Clear | Empties the container (destroys every element) |
Reserve | Reserves capacity to avoid reallocations |
At | Accesses an element by index (mutable version) |
At | Accesses an element by index (const version) |
operator[] | Index access operator (mutable version) |
operator[] | Index access operator (const version) |
Size | Gets the number of stored elements |
Capacity | Gets the allocated capacity |
Empty | Checks whether the container is empty |
Begin | Gets a pointer to the first element (mutable) |
Begin | Gets a pointer to the first element (const) |
End | Gets a pointer past the last element (mutable) |
End | Gets a pointer past the last element (const) |
Member details
Default constructor (empty vector)
Copy constructor
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
other | const NkEnvVector<T> & |
Move constructor
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
other | NkEnvVector<T> && |
Destructor (frees the memory and destroys the elements)
Copy assignment operator
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
other | const NkEnvVector<T> & |
Move assignment operator
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
other | NkEnvVector<T> && |
Appends an element at the end by copy
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
value | const T & |
Appends an element at the end by move
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
value | T && |
Removes the last element (destroys it)
Empties the container (destroys every element)
Reserves capacity to avoid reallocations
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
capacity | NkSize |
Accesses an element by index (mutable version)
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
index | NkSize |
Accesses an element by index (const version)
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
index | NkSize |
Index access operator (mutable version)
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
index | NkSize |
Index access operator (const version)
Parameters
| Name | Type | Role | Default |
|---|---|---|---|
index | NkSize |
Gets the number of stored elements
Gets the allocated capacity
Checks whether the container is empty
Gets a pointer to the first element (mutable)
Gets a pointer to the first element (const)
Gets a pointer past the last element (mutable)
Gets a pointer past the last element (const)