template<class SizeT>
Death::Containers::SmallVectorBase class

Base class of SmallVector.

Template parameters
SizeT Type of the size parameter

The template parameter specifies the type which should be used to hold the Size and Capacity of SmallVector, so it can be adjusted. Using 32-bit size is desirable to shrink the size of SmallVector. Using 64-bit size is desirable for cases like SmallVector<char>, where a 32 bit size would limit the vector to ~4GB.

Constructors, destructors, conversion operators

SmallVectorBase() protected deleted
SmallVectorBase(void* firstEl, std::size_t totalCapacity) protected

Public functions

auto size() const -> std::size_t
Returns the number of elements.
auto capacity() const -> std::size_t
Returns the number of elements that can be held in currently allocated storage.
auto empty() const -> bool
Returns whether the container is empty.

Protected static functions

static auto getSizeTypeMax() -> std::size_t constexpr
Maximum value of the SizeT type used.

Protected functions

auto mallocForGrow(void* firstEl, std::size_t minSize, std::size_t typeSize, std::size_t& newCapacity) -> void*
Creates a new allocation big enough for minSize and pass back its size in newCapacity.
void growTrivial(void* firstEl, std::size_t minSize, std::size_t typeSize)
Grows the allocated memory (without initializing new elements) for trivial types.
void setSize(std::size_t n)
Sets internal vector size.
void setAllocationRange(void* begin, size_t n)
Sets internal allocation range.

Protected variables

void* BeginX
Pointer to the first element.
SizeT Size
Number of elements in the vector.
SizeT Capacity
Capacity of the vector.