template <typename T, T... Elements>
muu::static_array struct

A statically-defined array.

Public types

using const_iterator = const value_type*
The iterator type returned by begin() and end().
using const_pointer = const value_type*
The const pointer type returned by data().
using const_reference = const value_type&
The const reference type returned by operator[].
using difference_type = ptrdiff_t
std::ptrdiff_t
using iterator = const value_type*
The iterator type returned by begin() and end().
using pointer = const value_type*
The pointer type returned by data().
using reference = const value_type&
The reference type returned by operator[].
using size_type = size_t
std::size_t
using value_type = std::add_const_t<T>
The type of each element in the array.

Public static variables

static value_type values constexpr
the elements in the array.

Public functions

auto back() const -> const_reference consteval noexcept
Returns the last element in the array.
auto data() const -> const_pointer consteval noexcept
Returns a const pointer to the first element in the array.
auto empty() const -> bool consteval noexcept
Returns true if the array is empty.
auto front() const -> const_reference consteval noexcept
Returns the first element in the array.
auto operator[](size_t index) const -> const_reference constexpr noexcept
Returns a const reference to the element at the selected index.
auto size() const -> size_type consteval noexcept
The number of elements in the array.

Equality and Comparison

template <T... E>
auto operator!=(static_array, static_array<T, E...>) -> bool consteval noexcept
Inequality operator.
template <T... E>
auto operator<(static_array, static_array<T, E...>) -> bool constexpr noexcept
Less-than operator.
template <T... E>
auto operator<=(static_array, static_array<T, E...>) -> bool constexpr noexcept
Less-than-equal-to operator.
template <T... E>
auto operator==(static_array, static_array<T, E...>) -> bool consteval noexcept
Equality operator.
template <T... E>
auto operator>(static_array, static_array<T, E...>) -> bool constexpr noexcept
Greater-than operator.
template <T... E>
auto operator>=(static_array, static_array<T, E...>) -> bool constexpr noexcept
Greater-than-equal-to operator.

Iterators

auto begin() const -> const_iterator consteval noexcept
Returns a const_iterator to the first element in the array.
auto cbegin() const -> const_iterator consteval noexcept
Returns a const_iterator to the first element in the array.
auto cend() const -> const_iterator consteval noexcept
Returns a const_iterator to one-past-the-last element in the array.
auto end() const -> const_iterator consteval noexcept
Returns a const_iterator to one-past-the-last element in the array.

Iterators (ADL)

auto begin(static_array) -> const_iterator consteval noexcept
Returns a const_iterator to the first element in the array.
auto cbegin(static_array) -> const_iterator consteval noexcept
Returns a const_iterator to the first element in the array.
auto cend(static_array) -> const_iterator consteval noexcept
Returns a const_iterator to one-past-the-last element in the array.
auto end(static_array) -> const_iterator consteval noexcept
Returns a const_iterator to one-past-the-last element in the array.