ludus::foundation::core::Array¶
Ludus Wiki · API overview · Browse API
Class
Note
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
#include <ludus/foundation/containers/array.hpp>
template <typename ElementType>
class ludus::foundation::core::Array
Types¶
ValueType¶
using ludus::foundation::core::Array< ElementType >::ValueType = ElementType
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
SizeType¶
using ludus::foundation::core::Array< ElementType >::SizeType = usize
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
Iterator¶
using ludus::foundation::core::Array< ElementType >::Iterator = ElementType*
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
ConstIterator¶
using ludus::foundation::core::Array< ElementType >::ConstIterator = const ElementType*
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
Methods¶
Array¶
constexpr ludus::foundation::core::Array< ElementType >::Array() noexcept=default
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
Array¶
ludus::foundation::core::Array< ElementType >::Array(std::initializer_list< ElementType > items)
requires std::is_copy_constructible_v<ElementType>
Array<int32>{3} holds one value, whereas (3) value-initializes three elements. Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
Array¶
explicit ludus::foundation::core::Array< ElementType >::Array(usize count)
count value-initialized elements in one exact allocation. Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
Array¶
ludus::foundation::core::Array< ElementType >::Array(usize count, const ElementType &value)
count copies of value in one exact allocation. Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
Array¶
ludus::foundation::core::Array< ElementType >::Array(const Array &other)
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
Array¶
ludus::foundation::core::Array< ElementType >::Array(Array &&other) noexcept
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
operator=¶
Array & ludus::foundation::core::Array< ElementType >::operator=(const Array &other)
Related types: Array
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
operator=¶
Array & ludus::foundation::core::Array< ElementType >::operator=(Array &&other) noexcept
Related types: Array
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
~Array¶
ludus::foundation::core::Array< ElementType >::~Array()
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
GetSize¶
usize ludus::foundation::core::Array< ElementType >::GetSize() const noexcept
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
GetCapacity¶
usize ludus::foundation::core::Array< ElementType >::GetCapacity() const noexcept
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
IsEmpty¶
bool ludus::foundation::core::Array< ElementType >::IsEmpty() const noexcept
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
GetData¶
ElementType * ludus::foundation::core::Array< ElementType >::GetData() noexcept
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
GetData¶
const ElementType * ludus::foundation::core::Array< ElementType >::GetData() const noexcept
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
EnsureCapacity¶
void ludus::foundation::core::Array< ElementType >::EnsureCapacity(usize newCapacity)
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
TryEnsureCapacity¶
bool ludus::foundation::core::Array< ElementType >::TryEnsureCapacity(usize newCapacity)
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
Resize¶
void ludus::foundation::core::Array< ElementType >::Resize(usize newSize)
newSize, destroying the tail or value-initializing new elements. newSize and invalidates all borrows. Allocation failure is fatal. Supports move-only element types. Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
Resize¶
void ludus::foundation::core::Array< ElementType >::Resize(usize newSize, const ElementType &value)
requires std::is_copy_constructible_v<ElementType>
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
TryResize¶
bool ludus::foundation::core::Array< ElementType >::TryResize(usize newSize)
Returns
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
TryResize¶
bool ludus::foundation::core::Array< ElementType >::TryResize(usize newSize, const ElementType &value)
requires std::is_copy_constructible_v<ElementType>
value into new elements. value may refer to an element of this array; it is copied before any relocation. Returns
value unchanged. Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
TrimCapacity¶
void ludus::foundation::core::Array< ElementType >::TrimCapacity()
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
Clear¶
void ludus::foundation::core::Array< ElementType >::Clear() noexcept
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
operator[]¶
ElementType & ludus::foundation::core::Array< ElementType >::operator[](usize index) noexcept
index. Precondition
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
operator[]¶
const ElementType & ludus::foundation::core::Array< ElementType >::operator[](usize index) const noexcept
index. Precondition
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
GetFirst¶
ElementType & ludus::foundation::core::Array< ElementType >::GetFirst() noexcept
Precondition
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
GetFirst¶
const ElementType & ludus::foundation::core::Array< ElementType >::GetFirst() const noexcept
Precondition
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
GetLast¶
ElementType & ludus::foundation::core::Array< ElementType >::GetLast() noexcept
Precondition
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
GetLast¶
const ElementType & ludus::foundation::core::Array< ElementType >::GetLast() const noexcept
Precondition
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
begin¶
Iterator ludus::foundation::core::Array< ElementType >::begin() noexcept
Related types: Iterator
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
begin¶
ConstIterator ludus::foundation::core::Array< ElementType >::begin() const noexcept
Related types: ConstIterator
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
cbegin¶
ConstIterator ludus::foundation::core::Array< ElementType >::cbegin() const noexcept
Related types: ConstIterator
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
end¶
Iterator ludus::foundation::core::Array< ElementType >::end() noexcept
Related types: Iterator
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
end¶
ConstIterator ludus::foundation::core::Array< ElementType >::end() const noexcept
Related types: ConstIterator
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
cend¶
ConstIterator ludus::foundation::core::Array< ElementType >::cend() const noexcept
Related types: ConstIterator
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
data¶
ElementType * ludus::foundation::core::Array< ElementType >::data() noexcept
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
data¶
const ElementType * ludus::foundation::core::Array< ElementType >::data() const noexcept
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
size¶
usize ludus::foundation::core::Array< ElementType >::size() const noexcept
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
Add¶
void ludus::foundation::core::Array< ElementType >::Add(const ElementType &value)
value; allocation failure is fatal. value may refer to an element of this array. Growth invalidates all borrows. Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
Add¶
void ludus::foundation::core::Array< ElementType >::Add(ElementType &&value)
value; allocation failure is fatal. Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
AddInPlace¶
template <typename... Args>
ElementType & ludus::foundation::core::Array< ElementType >::AddInPlace(Args &&... args)
args. Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
TryAdd¶
bool ludus::foundation::core::Array< ElementType >::TryAdd(const ElementType &value)
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
TryAdd¶
bool ludus::foundation::core::Array< ElementType >::TryAdd(ElementType &&value)
Returns
value is not moved from, even when it refers to an element of this array. Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
TryAddInPlace¶
template <typename... Args>
ElementType * ludus::foundation::core::Array< ElementType >::TryAddInPlace(Args &&... args)
args. args may borrow from this array. Returns
args untouched. Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
AddRange¶
void ludus::foundation::core::Array< ElementType >::AddRange(std::span< const ElementType > items)
Precondition
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
TryAddRange¶
bool ludus::foundation::core::Array< ElementType >::TryAddRange(std::span< const ElementType > items)
items, with at most one allocation. Precondition
items does not overlap this array's storage (asserted). Returns
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
RemoveLast¶
void ludus::foundation::core::Array< ElementType >::RemoveLast() noexcept
Precondition
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
RemoveAt¶
void ludus::foundation::core::Array< ElementType >::RemoveAt(usize index) noexcept
index (shifts the tail left). O(n). Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
RemoveRange¶
void ludus::foundation::core::Array< ElementType >::RemoveRange(usize first, usize last) noexcept
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
RemoveAtSwap¶
void ludus::foundation::core::Array< ElementType >::RemoveAtSwap(usize index) noexcept
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
InsertAt¶
ElementType & ludus::foundation::core::Array< ElementType >::InsertAt(usize index, const ElementType &value)
value at index, shifting later elements; allocation failure is fatal. Precondition
value may refer to an element of this array. Invalidates borrows at and after index, or all borrows on growth. Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
InsertAt¶
ElementType & ludus::foundation::core::Array< ElementType >::InsertAt(usize index, ElementType &&value)
value into index, shifting later elements; allocation failure is fatal. Precondition
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
InsertAtInPlace¶
template <typename... Args>
ElementType & ludus::foundation::core::Array< ElementType >::InsertAtInPlace(usize index, Args &&... args)
index, shifting the tail right. O(n). Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
TryInsertAt¶
ElementType * ludus::foundation::core::Array< ElementType >::TryInsertAt(usize index, const ElementType &value)
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
TryInsertAt¶
ElementType * ludus::foundation::core::Array< ElementType >::TryInsertAt(usize index, ElementType &&value)
index. Precondition
Returns
value not moved from. Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
TryInsertAtInPlace¶
template <typename... Args>
ElementType * ludus::foundation::core::Array< ElementType >::TryInsertAtInPlace(usize index, Args &&... args)
args. args are read; on growth the element is built in the new block while borrows into the old block remain valid. Precondition
Returns
args untouched. Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
Swap¶
void ludus::foundation::core::Array< ElementType >::Swap(Array &other) noexcept
other without allocating. Element borrows follow their storage. Related types: Array
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
operator std::span\< ElementType >¶
ludus::foundation::core::Array< ElementType >::operator std::span< ElementType >() noexcept
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
operator std::span\< const ElementType >¶
ludus::foundation::core::Array< ElementType >::operator std::span< const ElementType >() const noexcept
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
AsSpan¶
std::span< ElementType > ludus::foundation::core::Array< ElementType >::AsSpan() noexcept
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
AsSpan¶
std::span< const ElementType > ludus::foundation::core::Array< ElementType >::AsSpan() const noexcept
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
Static methods¶
GetMaxSize¶
static constexpr usize ludus::foundation::core::Array< ElementType >::GetMaxSize() noexcept
Related types: usize
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
FromRange¶
static Array ludus::foundation::core::Array< ElementType >::FromRange(std::span< const ElementType > items)
Related types: Array
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp
Members¶
operator==¶
bool operator==(const Array &a, const Array &b)
Related types: Array
Declared in modules/foundation/containers/include/ludus/foundation/containers/array.hpp