Death::Containers namespace

Container implementations.

Implementations for various containers which don't have direct equivalents in STL or are better tailored to specific use cases than general standard implementations.

Namespaces

namespace Literals
Container literals.
namespace StringUtils
String utilities.

Classes

struct AllocatedInitT
Allocated initialization tag type.
template<class T, class D = void(*)(T*, std::size_t)>
class Array
Array.
template<class T>
struct ArrayAllocator
Allocator for growable arrays.
template<class T>
struct ArrayMallocAllocator
Malloc-based allocator for growable arrays.
template<class T>
struct ArrayNewAllocator
New-based allocator for growable arrays.
template<class T>
class ArrayView
Array view.
template<>
class ArrayView<const void>
Constant void array view.
template<>
class ArrayView<void>
Void array view.
template<class T>
class BasicStringView
Base for string views.
class DateTime
Instant in time, typically expressed as a date and time of day.
struct DefaultInitT
Default initialization tag type.
struct DirectInitT
Direct initialization tag type.
template<class>
class Function
Function wrapper.
template<class R, class ... Args>
class Function<R(Args...)>
Function wrapper.
class FunctionData
Function data storage
struct InPlaceInitT
In-place initialization tag type.
template<typename IteratorT>
class iterator_range
struct NoAllocateInitT
No-allocate initialization tag type.
struct NoCreateT
No creation tag type.
struct NoInitT
No initialization tag type.
template<class, class>
class Pair
Pair of values.
template<class T>
class Reference
Lightweight non-owning reference wrapper.
template<typename T, unsigned N = CalculateSmallVectorDefaultInlinedElements<T>::value>
class SmallVector
Memory-optimized vector.
template<class Size_T>
class SmallVectorBase
SmallVector base class
template<typename T>
class SmallVectorImpl
Consists of common code of SmallVector class to reduce code duplication based on N template parameter.
template<typename T, unsigned N>
struct SmallVectorStorage
Storage for SmallVector elements.
template<typename T, bool = (std::is_trivially_copy_constructible<T>::value)&& (std::is_trivially_move_constructible<T>::value)&& std::is_trivially_destructible<T>::value>
class SmallVectorTemplateBase
SmallVector method implementations that are designed to work with non-trivial types
template<typename T>
class SmallVectorTemplateBase<T, true>
SmallVector method implementations that are designed to work with trivially copyable types
template<typename T>
class SmallVectorTemplateCommon
SmallVector part which does not depend on whether the type is a POD
template<std::size_t, class>
class StaticArray
Compile-time-sized array.
template<std::size_t size_, class T>
class StaticArrayView
Compile-time-sized array view.
class String
String.
template<typename A, typename B>
class StringBuilder
Resulting template object of a deferred string concatenation.
template<typename Builder, typename T>
struct StringBuilderBase
Resulting base object of a deferred string concatenation.
class TimeSpan
Time interval.
struct ValueInitT
Value initialization tag type.

Enums

enum class StringViewFlags : std::size_t { Global = std::size_t{1} << (sizeof(std::size_t) * 8 - 1), NullTerminated = std::size_t{1} << (sizeof(std::size_t) * 8 - 2) }

Typedefs

using StringView = BasicStringView<const char>
String view.
using MutableStringView = BasicStringView<char>
Mutable string view.

Functions

template<class T>
auto array(ArrayView<const T> list) -> Array<T>
Construct a list-initialized array.
template<class T>
auto array(std::initializer_list<T> list) -> Array<T>
Construct a list-initialized array.
template<class T, class D>
auto arrayView(Array<T, D>& array) -> ArrayView<T>
Make a view on an Array.
template<class T, class D>
auto arrayView(const Array<T, D>& array) -> ArrayView<const T>
Make a view on a const Array.
template<class U, class T, class D>
auto arrayCast(Array<T, D>& array) -> ArrayView<U>
Reinterpret-cast an array.
template<class U, class T, class D>
auto arrayCast(const Array<T, D>& array) -> ArrayView<const U>
template<class T>
auto arraySize(const Array<T>& view) -> std::size_t
Array size.
template<class T>
auto arrayView(T* data, std::size_t size) -> ArrayView<T> constexpr
Make a view on an array of specific length.
template<std::size_t size, class T>
auto arrayView(T(&data)[size]) -> ArrayView<T> constexpr
Make a view on fixed-size array.
template<class T>
auto arrayView(std::initializer_list<T> list) -> ArrayView<const T>
Make a view on an initializer list.
template<std::size_t size, class T>
auto arrayView(StaticArrayView<size, T> view) -> ArrayView<T> constexpr
Make a view on StaticArrayView.
template<class T>
auto arrayView(ArrayView<T> view) -> ArrayView<T> constexpr
Make a view on a view.
template<class T, class U = decltype(Implementation::ErasedArrayViewConverter<typename std::remove_reference<T && >::type>::from(std::declval<T && >()))>
auto arrayView(T&& other) -> U constexpr
Make a view on an external type / from an external representation.
template<class U, class T>
auto arrayCast(ArrayView<T> view) -> ArrayView<U>
Reinterpret-cast an array view.
template<class U>
auto arrayCast(ArrayView<const void> view) -> ArrayView<U>
Reinterpret-cast a void array view.
template<class T>
auto arraySize(ArrayView<T> view) -> std::size_t constexpr
Array view size.
template<std::size_t size_, class T>
auto arraySize(StaticArrayView<size_, T>) -> std::size_t constexpr
template<std::size_t size_, class T>
auto arraySize(T(&)[size_]) -> std::size_t constexpr
C array size.
template<std::size_t size_, class T, class U>
auto arraySize(U(T::*)[size_]) -> std::size_t constexpr
C array member size.
template<std::size_t size, class T>
auto staticArrayView(T* data) -> StaticArrayView<size, T> constexpr
Make a static view on an array.
template<std::size_t size, class T>
auto staticArrayView(T(&data)[size]) -> StaticArrayView<size, T> constexpr
Make a static view on a fixed-size array.
template<std::size_t size, class T>
auto staticArrayView(StaticArrayView<size, T> view) -> StaticArrayView<size, T> constexpr
Make a static view on a view.
template<class T, class U = decltype(Implementation::ErasedStaticArrayViewConverter<typename std::remove_reference<T && >::type>::from(std::declval<T && >()))>
auto staticArrayView(T&& other) -> U constexpr
Make a static view on an external type / from an external representation.
template<class U, std::size_t size, class T>
auto arrayCast(StaticArrayView<size, T> view) -> StaticArrayView<size*sizeof(T)/sizeof(U), U>
Reinterpret-cast a static array view.
template<class U, std::size_t size, class T>
auto arrayCast(T(&data)[size]) -> StaticArrayView<size*sizeof(T)/sizeof(U), U>
Reinterpret-cast a statically sized array.
template<class U, class T>
auto arrayAllocatorCast(Array<T>&& array) -> Array<U>
Reinterpret-cast a growable array.
template<class U, template<class> class Allocator, class T>
auto arrayAllocatorCast(Array<T>&& array) -> Array<U>
template<class T, class Allocator = ArrayAllocator<T>>
auto arrayIsGrowable(Array<T>& array) -> bool
Whether an array is growable.
template<class T, class Allocator = ArrayAllocator<T>>
auto arrayCapacity(Array<T>& array) -> std::size_t
Array capacity.
template<class T, class Allocator = ArrayAllocator<T>>
auto arrayReserve(Array<T>& array, std::size_t capacity) -> std::size_t
Reserve given capacity in an array.
template<class T, class Allocator = ArrayAllocator<T>>
void arrayResize(Array<T>& array, DefaultInitT, std::size_t size)
Resize an array to given size, default-initializing new elements.
template<class T, class Allocator = ArrayAllocator<T>>
void arrayResize(Array<T>& array, ValueInitT, std::size_t size)
Resize an array to given size, value-initializing new elements.
template<class T, class Allocator = ArrayAllocator<T>>
void arrayResize(Array<T>& array, std::size_t size)
Resize an array to given size, value-initializing new elements.
template<class T, class Allocator = ArrayAllocator<T>>
void arrayResize(Array<T>& array, NoInitT, std::size_t size)
Resize an array to given size, keeping new elements uninitialized.
template<class T, class ... Args>
void arrayResize(Array<T>& array, DirectInitT, std::size_t size, Args && ... args)
Resize an array to given size, constructing new elements using provided arguments.
template<class T, class Allocator, class ... Args>
void arrayResize(Array<T>& array, DirectInitT, std::size_t size, Args && ... args)
template<class T, class Allocator = ArrayAllocator<T>>
void arrayResize(Array<T>& array, std::size_t size, const typename std::common_type<T>::type& value)
Resize an array to given size, copy-constructing new elements using the provided value.
template<class T, class Allocator = ArrayAllocator<T>>
auto arrayAppend(Array<T>& array, const typename std::common_type<T>::type& value) -> T&
Copy-append an item to an array.
template<class T, class ... Args>
auto arrayAppend(Array<T>& array, InPlaceInitT, Args && ... args) -> T&
In-place append an item to an array.
template<class T, class Allocator, class ... Args>
auto arrayAppend(Array<T>& array, InPlaceInitT, Args && ... args) -> T&
template<class T, class Allocator = ArrayAllocator<T>>
auto arrayAppend(Array<T>& array, typename std::common_type<T>::type&& value) -> T&
Move-append an item to an array.
template<class T, class Allocator = ArrayAllocator<T>>
auto arrayAppend(Array<T>& array, typename std::common_type<ArrayView<const T>>::type values) -> ArrayView<T>
Copy-append a list of items to an array.
template<class T, class Allocator = ArrayAllocator<T>>
auto arrayAppend(Array<T>& array, std::initializer_list<typename std::common_type<T>::type> values) -> ArrayView<T>
template<class T, class Allocator = ArrayAllocator<T>>
auto arrayAppend(Array<T>& array, NoInitT, std::size_t count) -> ArrayView<T>
Append given count of uninitialized values to an array.
template<class T, class Allocator = ArrayAllocator<T>>
auto arrayInsert(Array<T>& array, std::size_t index, const typename std::common_type<T>::type& value) -> T&
Copy-insert an item into an array.
template<class T, class ... Args>
auto arrayInsert(Array<T>& array, std::size_t index, InPlaceInitT, Args && ... args) -> T&
In-place insert an item into an array.
template<class T, class Allocator, class ... Args>
auto arrayInsert(Array<T>& array, std::size_t index, InPlaceInitT, Args && ... args) -> T&
template<class T, class Allocator = ArrayAllocator<T>>
auto arrayInsert(Array<T>& array, std::size_t index, typename std::common_type<T>::type&& value) -> T&
Move-insert an item into an array.
template<class T, class Allocator = ArrayAllocator<T>>
auto arrayInsert(Array<T>& array, std::size_t index, typename std::common_type<ArrayView<const T>>::type values) -> ArrayView<T>
Copy-insert a list of items into an array.
template<class T, class Allocator = ArrayAllocator<T>>
auto arrayInsert(Array<T>& array, std::size_t index, std::initializer_list<typename std::common_type<T>::type> values) -> ArrayView<T>
template<class T, class Allocator = ArrayAllocator<T>>
auto arrayInsert(Array<T>& array, std::size_t index, NoInitT, std::size_t count) -> ArrayView<T>
Insert given count of uninitialized values into an array.
template<class T, class Allocator = ArrayAllocator<T>>
void arrayRemove(Array<T>& array, std::size_t index, std::size_t count = 1)
Remove an element from an array.
template<class T, class Allocator = ArrayAllocator<T>>
void arrayRemoveUnordered(Array<T>& array, std::size_t index, std::size_t count = 1)
Remove an element from an unordered array.
template<class T, class Allocator = ArrayAllocator<T>>
void arrayRemoveSuffix(Array<T>& array, std::size_t count = 1)
Remove a suffix from an array.
template<class T, class Allocator = ArrayAllocator<T>>
void arrayClear(Array<T>& array)
Clear an array.
template<class T, class Allocator = ArrayAllocator<T>>
void arrayShrink(Array<T>& array, NoInitT = NoInit)
Convert an array back to non-growable.
template<class T, class Allocator = ArrayAllocator<T>>
void arrayShrink(Array<T>& array, DefaultInitT)
Convert an array back to non-growable using a default initialization.
template<template<class> class Allocator, class T>
void arrayShrink(Array<T>& array)
template<class F, class S>
auto pair(F&& first, S&& second) -> Pair<typename std::decay<F>::type, typename std::decay<S>::type> constexpr
Make a pair.
template<class T>
auto pair(T&& other) -> decltype(Implementation::DeducedPairConverter<typename std::decay<T>::type>::from(Death::forward<T>(other)))
Make a pair from external representation.
template<class T>
auto reference(T& reference) -> Reference<T> constexpr
Make a reference wrapper.
template<std::size_t size, class T>
auto arrayView(StaticArray<size, T>& array) -> ArrayView<T> constexpr
Make a view on a StaticArray.
template<std::size_t size, class T>
auto arrayView(const StaticArray<size, T>& array) -> ArrayView<const T> constexpr
Make a view on a const StaticArray.
template<std::size_t size, class T>
auto staticArrayView(StaticArray<size, T>& array) -> StaticArrayView<size, T> constexpr
Make a static view on a StaticArray.
template<std::size_t size, class T>
auto staticArrayView(const StaticArray<size, T>& array) -> StaticArrayView<size, const T> constexpr
Make a static view on a const StaticArray.
template<class U, std::size_t size, class T>
auto arrayCast(StaticArray<size, T>& array) -> StaticArrayView<size*sizeof(T)/sizeof(U), U>
Reinterpret-cast a static array.
template<class U, std::size_t size, class T>
auto arrayCast(const StaticArray<size, T>& array) -> StaticArrayView<size*sizeof(T)/sizeof(U), const U>
template<std::size_t size_, class T>
auto arraySize(const StaticArray<size_, T>&) -> std::size_t constexpr
Static array size.
template<typename A, typename B, typename = std::void_t<typename Implementation::StringConcatenableEx<A>::type, typename Implementation::StringConcatenableEx<B>::type>>
auto operator+(A&& a, B&& b) -> auto
template<typename A, typename B>
auto operator+=(Array<char>& a, const StringBuilder<A, B>& b) -> Array<char>&
template<typename A, typename B>
auto operator+=(String& a, const StringBuilder<A, B>& b) -> String&
auto operator==(StringView a, StringView b) -> bool
auto operator!=(StringView a, StringView b) -> bool
auto operator<(StringView a, StringView b) -> bool
auto operator<=(StringView a, StringView b) -> bool
auto operator>=(StringView a, StringView b) -> bool
auto operator>(StringView a, StringView b) -> bool
auto operator*(StringView string, std::size_t count) -> String
String multiplication.
auto operator*(std::size_t count, StringView string) -> String
template<class T>
auto array(ArrayView<const T> list) -> Array<T>
Construct a list-initialized array.
template<class T>
auto array(std::initializer_list<T> list) -> Array<T>
Construct a list-initialized array.
template<class T, class D>
auto arrayView(Array<T, D>& array) -> ArrayView<T>
Make a view on an Array.
template<class T, class D>
auto arrayView(const Array<T, D>& array) -> ArrayView<const T>
Make a view on a const Array.
template<class U, class T, class D>
auto arrayCast(Array<T, D>& array) -> ArrayView<U>
Reinterpret-cast an array.
template<class T>
auto arrayView(T* data, std::size_t size) -> ArrayView<T> constexpr
Make a view on an array of specific length.
template<std::size_t size, class T>
auto arrayView(T(&data)[size]) -> ArrayView<T> constexpr
Make a view on fixed-size array.
template<class T>
auto arrayView(std::initializer_list<T> list) -> ArrayView<const T>
Make a view on an initializer list.
template<std::size_t size, class T>
auto arrayView(StaticArrayView<size, T> view) -> ArrayView<T> constexpr
Make a view on StaticArrayView.
template<class T>
auto arrayView(ArrayView<T> view) -> ArrayView<T> constexpr
Make a view on a view.
template<class T, class U = decltype(Implementation::ErasedArrayViewConverter<typename std::remove_reference<T && >::type>::from(std::declval<T && >()))>
auto arrayView(T&& other) -> U constexpr
Make a view on an external type / from an external representation.
template<class U, class T>
auto arrayCast(ArrayView<T> view) -> ArrayView<U>
Reinterpret-cast an array view.
template<class U>
auto arrayCast(ArrayView<const void> view) -> ArrayView<U>
Reinterpret-cast a void array view.
template<class U>
auto arrayCast(ArrayView<void> view) -> ArrayView<U>
template<class T>
auto arraySize(ArrayView<T> view) -> std::size_t constexpr
Array view size.
template<std::size_t size, class T>
auto staticArrayView(T* data) -> StaticArrayView<size, T> constexpr
Make a static view on an array.
template<std::size_t size, class T>
auto staticArrayView(T(&data)[size]) -> StaticArrayView<size, T> constexpr
Make a static view on a fixed-size array.
template<std::size_t size, class T>
auto staticArrayView(StaticArrayView<size, T> view) -> StaticArrayView<size, T> constexpr
Make a static view on a view.
template<class T, class U = decltype(Implementation::ErasedStaticArrayViewConverter<typename std::remove_reference<T && >::type>::from(std::declval<T && >()))>
auto staticArrayView(T&& other) -> U constexpr
Make a static view on an external type / from an external representation.
template<class U, std::size_t size, class T>
auto arrayCast(StaticArrayView<size, T> view) -> StaticArrayView<size*sizeof(T)/sizeof(U), U>
Reinterpret-cast a static array view.
template<class U, std::size_t size, class T>
auto arrayCast(T(&data)[size]) -> StaticArrayView<size*sizeof(T)/sizeof(U), U>
Reinterpret-cast a statically sized array.
template<class F, class S>
auto pair(F&& first, S&& second) -> Pair<typename std::decay<F>::type, typename std::decay<S>::type> constexpr
Make a pair.
template<class T>
auto pair(T&& other) -> decltype(Implementation::DeducedPairConverter<typename std::decay<T>::type>::from(Death::forward<T>(other)))
Make a pair from external representation.
template<class T>
auto reference(T& reference) -> Reference<T> constexpr
Make a reference wrapper.
template<std::size_t size, class T>
auto arrayView(StaticArray<size, T>& array) -> ArrayView<T> constexpr
Make a view on a StaticArray.
template<std::size_t size, class T>
auto arrayView(const StaticArray<size, T>& array) -> ArrayView<const T> constexpr
Make a view on a const StaticArray.
template<std::size_t size, class T>
auto staticArrayView(StaticArray<size, T>& array) -> StaticArrayView<size, T> constexpr
Make a static view on a StaticArray.
template<std::size_t size, class T>
auto staticArrayView(const StaticArray<size, T>& array) -> StaticArrayView<size, const T> constexpr
Make a static view on a const StaticArray.
template<class U, std::size_t size, class T>
auto arrayCast(StaticArray<size, T>& array) -> StaticArrayView<size*sizeof(T)/sizeof(U), U>
Reinterpret-cast a static array.
template<std::size_t size_, class T>
auto arraySize(const StaticArray<size_, T>&) -> std::size_t constexpr
Static array size.
auto operator""_s(const char* data, std::size_t size) -> StringView constexpr
String view literal.

Variables

NoAllocateInitT NoAllocateInit constexpr
No-allocate initialization tag.
AllocatedInitT AllocatedInit constexpr
Allocated initialization tag.
DefaultInitT DefaultInit constexpr
Default initialization tag.
ValueInitT ValueInit constexpr
Value initialization tag.
NoInitT NoInit constexpr
No initialization tag.
NoCreateT NoCreate constexpr
No creation tag.
DirectInitT DirectInit constexpr
Direct initialization tag.
InPlaceInitT InPlaceInit constexpr
In-place initialization tag.

Enum documentation

enum class Death::Containers::StringViewFlags : std::size_t

Enumerators
Global

The referenced string is global, i.e., with an unlimited lifetime. A string view with this flag set doesn't need to have a copy allocated in order to ensure it stays in scope.

NullTerminated

The referenced string is null-terminated. A string view with this flag set doesn't need to have a null-terminated copy allocated in order to pass to an API that expects only null-terminated strings.

Typedef documentation

typedef BasicStringView<const char> Death::Containers::StringView

String view.

Immutable, use MutableStringView for mutable access.

typedef BasicStringView<char> Death::Containers::MutableStringView

Mutable string view.

Function documentation

template<class T>
Array<T> Death::Containers::array(ArrayView<const T> list)

Construct a list-initialized array.

Convenience shortcut to the Array::Array(InPlaceInitT, ArrayView<const T>) constructor. Not present as an implicit constructor in order to avoid the same usability issues as with std::vector.

template<class T>
Array<T> Death::Containers::array(std::initializer_list<T> list)

Construct a list-initialized array.

Convenience shortcut to the Array::Array(InPlaceInitT, std::initializer_list<T>) constructor. Not present as an implicit constructor in order to avoid the same usability issues as with std::vector.

template<class T, class D>
ArrayView<T> Death::Containers::arrayView(Array<T, D>& array)

Make a view on an Array.

Convenience alternative to converting to an ArrayView explicitly.

template<class T, class D>
ArrayView<const T> Death::Containers::arrayView(const Array<T, D>& array)

Make a view on a const Array.

Convenience alternative to converting to an ArrayView explicitly.

template<class U, class T, class D>
ArrayView<U> Death::Containers::arrayCast(Array<T, D>& array)

Reinterpret-cast an array.

template<class U, class T, class D>
ArrayView<const U> Death::Containers::arrayCast(const Array<T, D>& array)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T>
std::size_t Death::Containers::arraySize(const Array<T>& view)

Array size.

template<class T>
ArrayView<T> Death::Containers::arrayView(T* data, std::size_t size) constexpr

Make a view on an array of specific length.

Convenience alternative to ArrayView::ArrayView(T*, std::size_t).

template<std::size_t size, class T>
ArrayView<T> Death::Containers::arrayView(T(&data)[size]) constexpr

Make a view on fixed-size array.

Convenience alternative to ArrayView::ArrayView(U(&)[size]).

template<class T>
ArrayView<const T> Death::Containers::arrayView(std::initializer_list<T> list)

Make a view on an initializer list.

Not present as a constructor in order to avoid accidental dangling references with r-value initializer lists.

template<std::size_t size, class T>
ArrayView<T> Death::Containers::arrayView(StaticArrayView<size, T> view) constexpr

Make a view on StaticArrayView.

Convenience alternative to ArrayView::ArrayView(StaticArrayView<size, U>).

template<class T>
ArrayView<T> Death::Containers::arrayView(ArrayView<T> view) constexpr

Make a view on a view.

Equivalent to the implicit ArrayView copy constructor — it shouldn't be an error to call arrayView() on itself.

template<class T, class U = decltype(Implementation::ErasedArrayViewConverter<typename std::remove_reference<T && >::type>::from(std::declval<T && >()))>
U Death::Containers::arrayView(T&& other) constexpr

Make a view on an external type / from an external representation.

template<class U, class T>
ArrayView<U> Death::Containers::arrayCast(ArrayView<T> view)

Reinterpret-cast an array view.

Size of the new array is calculated as view.size()*sizeof(T)/sizeof(U). Expects that both types are standard layout and the total byte size doesn't change.

template<class U>
ArrayView<U> Death::Containers::arrayCast(ArrayView<const void> view)

Reinterpret-cast a void array view.

Size of the new array is calculated as view.size()/sizeof(U). Expects that the target type is standard layout and the total byte size doesn't change.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T>
std::size_t Death::Containers::arraySize(ArrayView<T> view) constexpr

Array view size.

Alias to ArrayView::size(). See also arraySize(T(&)[size_]) for querying size of a C array and arraySize(U(T::*)[size_]) for querying size of a C array member.

template<std::size_t size_, class T>
std::size_t Death::Containers::arraySize(StaticArrayView<size_, T>) constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<std::size_t size_, class T>
std::size_t Death::Containers::arraySize(T(&)[size_]) constexpr

C array size.

Equivalent to std::size() from C++17. See also arraySize(U(T::*)[size_]) for querying size of an array member.

template<std::size_t size_, class T, class U>
std::size_t Death::Containers::arraySize(U(T::*)[size_]) constexpr

C array member size.

Variant of arraySize(T(&)[size_]) that works on array members. Note that you have to form a pointer to a member with & for this to work.

template<std::size_t size, class T>
StaticArrayView<size, T> Death::Containers::staticArrayView(T* data) constexpr

Make a static view on an array.

Convenience alternative to StaticArrayView::StaticArrayView(T*).

template<std::size_t size, class T>
StaticArrayView<size, T> Death::Containers::staticArrayView(T(&data)[size]) constexpr

Make a static view on a fixed-size array.

Convenience alternative to StaticArrayView::StaticArrayView(U(&)[size_]).

template<std::size_t size, class T>
StaticArrayView<size, T> Death::Containers::staticArrayView(StaticArrayView<size, T> view) constexpr

Make a static view on a view.

Equivalent to the implicit StaticArrayView copy constructor — it shouldn't be an error to call staticArrayView() on itself.

template<class T, class U = decltype(Implementation::ErasedStaticArrayViewConverter<typename std::remove_reference<T && >::type>::from(std::declval<T && >()))>
U Death::Containers::staticArrayView(T&& other) constexpr

Make a static view on an external type / from an external representation.

template<class U, std::size_t size, class T>
StaticArrayView<size*sizeof(T)/sizeof(U), U> Death::Containers::arrayCast(StaticArrayView<size, T> view)

Reinterpret-cast a static array view.

Size of the new array is calculated as view.size()*sizeof(T)/sizeof(U). Expects that both types are standard layout and the total byte size doesn't change.

template<class U, std::size_t size, class T>
StaticArrayView<size*sizeof(T)/sizeof(U), U> Death::Containers::arrayCast(T(&data)[size])

Reinterpret-cast a statically sized array.

Calls arrayCast(StaticArrayView<size, T>) with the argument converted to StaticArrayView of the same type and size.

template<class U, class T>
Array<U> Death::Containers::arrayAllocatorCast(Array<T>&& array)

Reinterpret-cast a growable array.

If the array is growable using ArrayMallocAllocator (which is aliased to ArrayAllocator for all trivially-copyable types), the deleter is a simple call to a typeless std::free(). This makes it possible to change the array type without having to use a different deleter, losing the growable property in the process.

Equivalently to arrayCast(), the size of the new array is calculated as view.size()*sizeof(T)/sizeof(U). Expects that both types are trivially copyable and standard layout and the total byte size doesn't change.

template<class U, template<class> class Allocator, class T>
Array<U> Death::Containers::arrayAllocatorCast(Array<T>&& array)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T, class Allocator = ArrayAllocator<T>>
bool Death::Containers::arrayIsGrowable(Array<T>& array)

Whether an array is growable.

Returns true if the array is growable and using given Allocator, false otherwise. Note that even non-growable arrays are usable with the arrayAppend(), arrayReserve(), ... family of utilities — these will reallocate the array using provided allocator if needed.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
std::size_t Death::Containers::arrayCapacity(Array<T>& array)

Array capacity.

For a growable array using given Allocator returns its capacity, otherwise returns Array::size().

This function is equivalent to calling capacity() on a std::vector.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
std::size_t Death::Containers::arrayReserve(Array<T>& array, std::size_t capacity)

Reserve given capacity in an array.

Returns New capacity of the array

If array capacity is already large enough, the function returns the current capacity. Otherwise the memory is reallocated to desired capacity, with the Array::size() staying the same, and capacity returned back. Note that in case the array is non-growable of sufficient size, it's kept as such, without being reallocated to a growable version.

Complexity is at most $ \mathcal{O}(n) $ in the size of the original container, $ \mathcal{O}(1) $ if the capacity is already large enough or if the reallocation can be done in-place. On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible and move-assignable.

This function is equivalent to calling reserve() on a std::vector.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
void Death::Containers::arrayResize(Array<T>& array, DefaultInitT, std::size_t size)

Resize an array to given size, default-initializing new elements.

If the array is growable and capacity is large enough, calls a destructor on elements that get cut off the end (if any, and if T is not trivially destructible, in which case nothing is done) and returns. Otherwise, the memory is reallocated to desired size. After that, new elements at the end of the array are default-initialized using placement-new (and nothing done for trivial types). Note that in case the array is non-growable of exactly the requested size, it's kept as such, without being reallocated to a growable version.

Complexity is at most $ \mathcal{O}(n) $ in the size of the new container, $ \mathcal{O}(1) $ if current container size is already exactly of given size. On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible and default-constructible.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
void Death::Containers::arrayResize(Array<T>& array, ValueInitT, std::size_t size)

Resize an array to given size, value-initializing new elements.

Similar to arrayResize(Array<T>&, DefaultInitT, std::size_t) except that the new elements at the end are not default-initialized, but value-initialized (i.e., trivial types zero-initialized and default constructor called otherwise).

On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible and default-constructible.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
void Death::Containers::arrayResize(Array<T>& array, std::size_t size)

Resize an array to given size, value-initializing new elements.

Alias to arrayResize(Array<T>&, ValueInitT, std::size_t).

This function is equivalent to calling resize() on a std::vector.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
void Death::Containers::arrayResize(Array<T>& array, NoInitT, std::size_t size)

Resize an array to given size, keeping new elements uninitialized.

Similar to arrayResize(Array<T>&, DefaultInitT, std::size_t) except that the new elements at the end are not default-initialized, but left in an uninitialized state instead. I.e., placement-new is meant to be used on all newly added elements with a non-trivially-copyable T.

On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class ... Args>
void Death::Containers::arrayResize(Array<T>& array, DirectInitT, std::size_t size, Args && ... args)

Resize an array to given size, constructing new elements using provided arguments.

Similar to arrayResize(Array<T>&, ValueInitT, std::size_t) except that the new elements at the end are constructed using placement-new with provided args.

On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible and constructible from provided args.

template<class T, class Allocator, class ... Args>
void Death::Containers::arrayResize(Array<T>& array, DirectInitT, std::size_t size, Args && ... args)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
void Death::Containers::arrayResize(Array<T>& array, std::size_t size, const typename std::common_type<T>::type& value)

Resize an array to given size, copy-constructing new elements using the provided value.

Calls arrayResize(Array<T>&, DirectInitT, std::size_t, Args&&... args) with value.

This function is equivalent to calling resize() on a std::vector.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
T& Death::Containers::arrayAppend(Array<T>& array, const typename std::common_type<T>::type& value)

Copy-append an item to an array.

Returns Reference to the newly appended item

If the array is not growable or the capacity is not large enough, the array capacity is grown first according to rules described in the grow() function of a particular allocator. Then, value is copy-constructed at the end of the array and Array::size() increased by 1.

Amortized complexity is $ \mathcal{O}(1) $ providing the allocator growth ratio is exponential. On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible and copy-constructible.

To have the append operation as performant as possible, the value reference is expected to not point inside array. If you need to append values from within the array itself, use the list-taking arrayAppend(Array<T>&, typename std::common_type<ArrayView<const T>>::type) overload, which handles this case.

This function is equivalent to calling push_back() on a std::vector.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class ... Args>
T& Death::Containers::arrayAppend(Array<T>& array, InPlaceInitT, Args && ... args)

In-place append an item to an array.

Returns Reference to the newly appended item

Similar to arrayAppend(Array<T>&, const typename std::common_type<T>::type&) except that the new element is constructed using placement-new with provided args.

On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible and constructible from provided args.

The behavior is undefined if any args are pointing inside the array items or their internals as the implementation has no way to check for such scenario. If you want to have robust checks against such cases, use the arrayAppend(Array<T>&, const typename std::common_type<T>::type&), arrayAppend(Array<T>&, typename std::common_type<T>::type&&) overloads which perform a copy or move instead of an in-place construction, or the list-taking arrayAppend(Array<T>&, typename std::common_type<ArrayView<const T>>::type) which detects and appropriately adjusts the view in case it's a slice of the array itself.

This function is equivalent to calling emplace_back() on a std::vector.

template<class T, class Allocator, class ... Args>
T& Death::Containers::arrayAppend(Array<T>& array, InPlaceInitT, Args && ... args)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
T& Death::Containers::arrayAppend(Array<T>& array, typename std::common_type<T>::type&& value)

Move-append an item to an array.

Returns Reference to the newly appended item

Calls arrayAppend(Array<T>&, InPlaceInitT, Args&&... args) with value.

To have the append operation as performant as possible, the value reference is expected to not point inside array. If you need to move-append values from within the array itself, move them to a temporary location first.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
ArrayView<T> Death::Containers::arrayAppend(Array<T>& array, typename std::common_type<ArrayView<const T>>::type values)

Copy-append a list of items to an array.

Returns View on the newly appended items

Like arrayAppend(Array<T>&, const typename std::common_type<T>::type&), but inserting multiple values at once.

On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible and copy-constructible.

Compared to the single-value arrayAppend(Array<T>&, const typename std::common_type<T>::type&), this function also handles the case where values are a slice of the array itself. In particular, if the array needs to be reallocated in order to fit the new items, the arrayvalues to append are then copied from the new location.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
ArrayView<T> Death::Containers::arrayAppend(Array<T>& array, std::initializer_list<typename std::common_type<T>::type> values)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
ArrayView<T> Death::Containers::arrayAppend(Array<T>& array, NoInitT, std::size_t count)

Append given count of uninitialized values to an array.

Returns View on the newly appended items

A lower-level variant of arrayAppend(Array<T>&, typename std::common_type<ArrayView<const T>>::type) where the new values are meant to be initialized in-place after, instead of being copied from a pre-existing location. The new values are always uninitialized — i.e., placement-new is meant to be used on all inserted elements with a non-trivially-copyable T.

On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
T& Death::Containers::arrayInsert(Array<T>& array, std::size_t index, const typename std::common_type<T>::type& value)

Copy-insert an item into an array.

Returns Reference to the newly inserted item

Expects that index is not larger than Array::size(). If the array is not growable or the capacity is not large enough, the array capacity is grown first according to rules described in the grow() function of a particular allocator. Then, items starting at index are moved one item forward, value is copied to index and Array::size() is increased by 1.

Amortized complexity is $ \mathcal{O}(n) $ . On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible, nothrow move-assignable and copy-constructible.

To have the insert operation as performant as possible, the value reference is expected to not point inside array. If you need to insert values from within the array itself, use the list-taking arrayInsert(Array<T>&, std::size_t, typename std::common_type<ArrayView<const T>>::type) overload, which handles this case.

This function is equivalent to calling insert() on a std::vector.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class ... Args>
T& Death::Containers::arrayInsert(Array<T>& array, std::size_t index, InPlaceInitT, Args && ... args)

In-place insert an item into an array.

Returns Reference to the newly inserted item

Similar to arrayInsert(Array<T>&, std::size_t, const typename std::common_type<T>::type&) except that the new element is constructed using placement-new with provided args.

On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible, nothrow move-assignable and constructible from provided args.

The behavior is undefined if any args are pointing inside the array items or their internals as the implementation has no way to check for such scenario. If you want to have robust checks against such cases, use the arrayInsert(Array<T>&, std::size_t, const typename std::common_type<T>::type&), arrayInsert(Array<T>&, std::size_t, typename std::common_type<T>::type&&) overloads which perform a copy or move instead of an in-place construction, or the list-taking arrayInsert(Array<T>&, std::size_t, typename std::common_type<ArrayView<const T>>::type) which detects and appropriately adjusts the view in case it's a slice of the array itself.

This function is equivalent to calling emplace() on a std::vector.

template<class T, class Allocator, class ... Args>
T& Death::Containers::arrayInsert(Array<T>& array, std::size_t index, InPlaceInitT, Args && ... args)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
T& Death::Containers::arrayInsert(Array<T>& array, std::size_t index, typename std::common_type<T>::type&& value)

Move-insert an item into an array.

Returns Reference to the newly appended item

Calls arrayInsert(Array<T>&, std::size_t, InPlaceInitT, Args&&... args) with value.

To have the insert operation as performant as possible, the value reference is expected to not point inside array. If you need to move-insert values from within the array itself, move them to a temporary location first.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
ArrayView<T> Death::Containers::arrayInsert(Array<T>& array, std::size_t index, typename std::common_type<ArrayView<const T>>::type values)

Copy-insert a list of items into an array.

Returns View on the newly appended items

Like arrayInsert(Array<T>&, std::size_t, const typename std::common_type<T>::type&), but inserting multiple values at once.

Amortized complexity is $ \mathcal{O}(m + n) $ , where $ m $ is the number of items being inserted and $ n $ is the existing array size. On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible, nothrow move-assignable and copy-constructible.

Compared to the single-value arrayInsert(Array<T>&, std::size_t, const typename std::common_type<T>::type&), this function also handles the case where values are a slice of the array itself. In particular, if the array needs to be reallocated in order to fit the new items, the values to insert are then copied from the new location. It's however expected that the slice and index don't overlap — in that case the caller has to handle that on its own, such as by splitting the insertion in two.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
ArrayView<T> Death::Containers::arrayInsert(Array<T>& array, std::size_t index, std::initializer_list<typename std::common_type<T>::type> values)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
ArrayView<T> Death::Containers::arrayInsert(Array<T>& array, std::size_t index, NoInitT, std::size_t count)

Insert given count of uninitialized values into an array.

Returns View on the newly appended items

A lower-level variant of arrayInsert(Array<T>&, std::size_t, typename std::common_type<ArrayView<const T>>::type) where the new values are meant to be initialized in-place after, instead of being copied from a pre-existing location. Independently of whether the array was reallocated to fit the new items or the items were just shifted around because the capacity was large enough, the new values are always uninitialized — i.e., placement-new is meant to be used on all inserted elements with a non-trivially-copyable T.

Amortized complexity is $ \mathcal{O}(n) $ , where $ n $ is the existing array size. On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible and nothrow move-assignable.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
void Death::Containers::arrayRemove(Array<T>& array, std::size_t index, std::size_t count = 1)

Remove an element from an array.

Expects that index + count is not larger than Array::size(). If the array is not growable, all elements except the removed ones are reallocated to a growable version. Otherwise, items starting at index + count are moved count items backward and the Array::size() is decreased by count.

Amortized complexity is $ \mathcal{O}(m + n) $ where $ m $ is the number of items being removed and $ n $ is the array size after removal. On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible and nothrow move-assignable.

This function is equivalent to calling erase() on a std::vector.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
void Death::Containers::arrayRemoveUnordered(Array<T>& array, std::size_t index, std::size_t count = 1)

Remove an element from an unordered array.

A variant of arrayRemove() that is more efficient in case the order of items in the array doesn't have to be preserved. Expects that index + count is not larger than Array::size(). If the array is not growable, all elements except the removed ones are reallocated to a growable version. Otherwise, the last min(count, array.size() - index - count) items are moved over the items at index and the Array::size() is decreased by count.

Amortized complexity is $ \mathcal{O}(m) $ where $ m $ is the number of items being removed. On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible and nothrow move-assignable.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
void Death::Containers::arrayRemoveSuffix(Array<T>& array, std::size_t count = 1)

Remove a suffix from an array.

Expects that count is not larger than Array::size(). If the array is not growable, all its elements except the removed suffix are reallocated to a growable version. Otherwise, a destructor is called on removed elements and the Array::size() is decreased by count.

Amortized complexity is $ \mathcal{O}(m) $ where $ m $ is the number of items removed. On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible.

With count set to 1, this function is equivalent to calling pop_back() on a std::vector.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class T, class Allocator = ArrayAllocator<T>>
void Death::Containers::arrayClear(Array<T>& array)

Clear an array.

If the array is not growable, it's replaced by an empty instance, freeing its contents as a whole. Otherwise a destructor is called on all existing elements and the Array::size() is set to 0, with arrayCapacity() staying the same as before. Amortized complexity is $ \mathcal{O}(n) $ where $ n $ is the number of items in the array. On top of what the Allocator (or the default ArrayAllocator) itself needs, T is required to be nothrow move-constructible. This function is equivalent to calling clear() on a std::vector.

template<class T, class Allocator = ArrayAllocator<T>>
void Death::Containers::arrayShrink(Array<T>& array, NoInitT = NoInit)

Convert an array back to non-growable.

Allocates a NoInit array that's exactly large enough to fit Array::size() elements, move-constructs the elements there and frees the old memory using Array::deleter(). If the array is not growable using given Allocator, it's assumed to be already as small as possible, and nothing is done.

Complexity is at most $ \mathcal{O}(n) $ in the size of the container, $ \mathcal{O}(1) $ if the array is already non-growable. No constraints on T from Allocator (or the default ArrayAllocator) apply here but T is required to be nothrow move-constructible.

This function is equivalent to calling shrink_to_fit() on a std::vector.

template<class T, class Allocator = ArrayAllocator<T>>
void Death::Containers::arrayShrink(Array<T>& array, DefaultInitT)

Convert an array back to non-growable using a default initialization.

Allocates a DefaultInit array that's exactly large enough to fit Array::size() elements, move-assigns the elements there and frees the old memory using Array::deleter(). If the array is not growable using given Allocator, it's assumed to be already as small as possible, and nothing is done.

Complexity is at most $ \mathcal{O}(n) $ in the size of the container, $ \mathcal{O}(1) $ if the array is already non-growable. No constraints on T from Allocator (or the default ArrayAllocator) apply here but T is required to be default-constructible and nothrow move-assignable.

Compared to arrayShrink(Array<T>&, NoInitT), the resulting array instance always has a default (nullptr) deleter. This is useful when it's not possible to use custom deleters, such as in plugin implementations.

template<template<class> class Allocator, class T>
void Death::Containers::arrayShrink(Array<T>& array)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Convenience overload allowing to specify just the allocator template, with array type being inferred.

template<class F, class S>
Pair<typename std::decay<F>::type, typename std::decay<S>::type> Death::Containers::pair(F&& first, S&& second) constexpr

Make a pair.

Convernience alternative to Pair::Pair(const F&, const S&) and overloads.

template<class T>
decltype(Implementation::DeducedPairConverter<typename std::decay<T>::type>::from(Death::forward<T>(other))) Death::Containers::pair(T&& other)

Make a pair from external representation.

template<class T>
Reference<T> Death::Containers::reference(T& reference) constexpr

Make a reference wrapper.

Convenience alternative to Reference::Reference(T&).

Useful for example when iterating a list of variables that need to be modified in-place, and where the code would otherwise have to be extra verbose or would fall back to raw pointers and risk them getting nullptr.

template<std::size_t size, class T>
ArrayView<T> Death::Containers::arrayView(StaticArray<size, T>& array) constexpr

Make a view on a StaticArray.

Convenience alternative to converting to an ArrayView explicitly.

template<std::size_t size, class T>
ArrayView<const T> Death::Containers::arrayView(const StaticArray<size, T>& array) constexpr

Make a view on a const StaticArray.

Convenience alternative to converting to an ArrayView explicitly.

template<std::size_t size, class T>
StaticArrayView<size, T> Death::Containers::staticArrayView(StaticArray<size, T>& array) constexpr

Make a static view on a StaticArray.

Convenience alternative to converting to an StaticArrayView explicitly.

template<std::size_t size, class T>
StaticArrayView<size, const T> Death::Containers::staticArrayView(const StaticArray<size, T>& array) constexpr

Make a static view on a const StaticArray.

Convenience alternative to converting to an StaticArrayView explicitly.

template<class U, std::size_t size, class T>
StaticArrayView<size*sizeof(T)/sizeof(U), U> Death::Containers::arrayCast(StaticArray<size, T>& array)

Reinterpret-cast a static array.

See arrayCast(StaticArrayView<size, T>) for more information.

template<class U, std::size_t size, class T>
StaticArrayView<size*sizeof(T)/sizeof(U), const U> Death::Containers::arrayCast(const StaticArray<size, T>& array)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<std::size_t size_, class T>
std::size_t Death::Containers::arraySize(const StaticArray<size_, T>&) constexpr

Static array size.

See arraySize(ArrayView<T>) for more information.

template<typename A, typename B, typename = std::void_t<typename Implementation::StringConcatenableEx<A>::type, typename Implementation::StringConcatenableEx<B>::type>>
auto Death::Containers::operator+(A&& a, B&& b)

template<typename A, typename B>
Array<char>& Death::Containers::operator+=(Array<char>& a, const StringBuilder<A, B>& b)

template<typename A, typename B>
String& Death::Containers::operator+=(String& a, const StringBuilder<A, B>& b)

bool Death::Containers::operator==(StringView a, StringView b)

bool Death::Containers::operator!=(StringView a, StringView b)

bool Death::Containers::operator<(StringView a, StringView b)

bool Death::Containers::operator<=(StringView a, StringView b)

bool Death::Containers::operator>=(StringView a, StringView b)

bool Death::Containers::operator>(StringView a, StringView b)

String Death::Containers::operator*(StringView string, std::size_t count)

String multiplication.

Equivalent to string multiplication in Python, returns string repeated count times.

String Death::Containers::operator*(std::size_t count, StringView string)

Variable documentation

NoAllocateInitT Death::Containers::NoAllocateInit constexpr

No-allocate initialization tag.

Used to distinguish Function construction that disallows allocating stateful function data on heap.

AllocatedInitT Death::Containers::AllocatedInit constexpr

Allocated initialization tag.

Use for String construction that bypasses small string optimization.

DefaultInitT Death::Containers::DefaultInit constexpr

Default initialization tag.

Use for construction with default initialization. The actual meaning of "default" may vary, see documentation of a particular API using this tag for a detailed behavior description.

ValueInitT Death::Containers::ValueInit constexpr

Value initialization tag.

Use for construction using value initialization (built-in types are zeroed out, others are default-constructed).

NoInitT Death::Containers::NoInit constexpr

No initialization tag.

Use for construction with no initialization at all.

NoCreateT Death::Containers::NoCreate constexpr

No creation tag.

Use for construction with initialization, but keeping the instance empty (usually equivalent to a moved-out state).

DirectInitT Death::Containers::DirectInit constexpr

Direct initialization tag.

Use for construction with direct initialization.

InPlaceInitT Death::Containers::InPlaceInit constexpr

In-place initialization tag.

Use for construction in-place.