Rihen Rihen NkentseuDocumentation
Development version, not published. Built from main: it shows what is coming (fixes, descriptions written since the last tag) and can change with every commit. Go to the stable version 0.1.0-beta.11

NkEnvVector

classgeneric (template)

Generic dynamic vector container (without the STL)

Include
#include "NKPlatform/NkEnv.h"
Namespace
nkentseu::env
Link (Jenga)
nkentseudependson(["NKPlatform"])
C++
template <typename T> class NkEnvVector

Hierarchy

Base classes : none. Derived classes : none.

Hierarchy : NkEnvVectorNkEnvVector

Members · 22

NkEnvVectorDefault constructor (empty vector)
NkEnvVectorCopy constructor
NkEnvVectorMove constructor
~NkEnvVectorDestructor (frees the memory and destroys the elements)
operator=Copy assignment operator
operator=Move assignment operator
PushBackAppends an element at the end by copy
PushBackAppends an element at the end by move
PopBackRemoves the last element (destroys it)
ClearEmpties the container (destroys every element)
ReserveReserves capacity to avoid reallocations
AtAccesses an element by index (mutable version)
AtAccesses an element by index (const version)
operator[]Index access operator (mutable version)
operator[]Index access operator (const version)
SizeGets the number of stored elements
CapacityGets the allocated capacity
EmptyChecks whether the container is empty
BeginGets a pointer to the first element (mutable)
BeginGets a pointer to the first element (const)
EndGets a pointer past the last element (mutable)
EndGets a pointer past the last element (const)

Member details

NkEnvVector

#
constructor
NkEnvVector() noexcept

Default constructor (empty vector)

NkEnvVector

#
constructor
NkEnvVector(const NkEnvVector &other)

Copy constructor

Parameters

NameTypeRoleDefault
otherconst NkEnvVector<T> &

NkEnvVector

#
constructor
NkEnvVector(NkEnvVector &&other) noexcept

Move constructor

Parameters

NameTypeRoleDefault
otherNkEnvVector<T> &&

~NkEnvVector

#
destructor
~NkEnvVector()

Destructor (frees the memory and destroys the elements)

operator=

#
method
NkEnvVector &operator=(const NkEnvVector &other)

Copy assignment operator

Parameters

NameTypeRoleDefault
otherconst NkEnvVector<T> &

operator=

#
method
NkEnvVector &operator=(NkEnvVector &&other) noexcept

Move assignment operator

Parameters

NameTypeRoleDefault
otherNkEnvVector<T> &&

PushBack

#
method
void PushBack(const T &value)

Appends an element at the end by copy

Parameters

NameTypeRoleDefault
valueconst T &

PushBack

#
method
void PushBack(T &&value)

Appends an element at the end by move

Parameters

NameTypeRoleDefault
valueT &&

PopBack

#
method
void PopBack() noexcept

Removes the last element (destroys it)

Clear

#
method
void Clear() noexcept

Empties the container (destroys every element)

Reserve

#
method
void Reserve(NkSize capacity)

Reserves capacity to avoid reallocations

Parameters

NameTypeRoleDefault
capacityNkSize

At

#
method
T &At(NkSize index)

Accesses an element by index (mutable version)

Parameters

NameTypeRoleDefault
indexNkSize

At

#
method
const T &At(NkSize index) const

Accesses an element by index (const version)

Parameters

NameTypeRoleDefault
indexNkSize

operator[]

#
method
T &operator[](NkSize index)

Index access operator (mutable version)

Parameters

NameTypeRoleDefault
indexNkSize

operator[]

#
method
const T &operator[](NkSize index) const

Index access operator (const version)

Parameters

NameTypeRoleDefault
indexNkSize

Size

#
method
NkSize Size() const noexcept

Gets the number of stored elements

Capacity

#
method
NkSize Capacity() const noexcept

Gets the allocated capacity

Empty

#
method
bool Empty() const noexcept

Checks whether the container is empty

Begin

#
method
T *Begin() noexcept

Gets a pointer to the first element (mutable)

Begin

#
method
const T *Begin() const noexcept

Gets a pointer to the first element (const)

End

#
method
T *End() noexcept

Gets a pointer past the last element (mutable)

End

#
method
const T *End() const noexcept

Gets a pointer past the last element (const)