#include <muu/static_array.h>
template <typename T, T... Elements>
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.