Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
arene::base::array< T, 0 > Class Template Reference

Specialize for zero-sized arrays as 'T array[0]' is not standards compliant. More...

Public Types

using const_iterator
 An iterator for the array that treats the elements as const.
 
using const_iterator = typename span<T const, 0>::iterator
 An iterator for the array that treats the elements as const.
 
using const_pointer
 The type of a pointer to a const array element.
 
using const_pointer = T const*
 The type of a pointer to a const array element.
 
using const_reference
 The type of a reference to a const array element.
 
using const_reference = T const&
 The type of a reference to a const array element.
 
using const_reverse_iterator
 An iterator for iteration through the array in reverse order that treats the elements as const.
 
using const_reverse_iterator = typename span<T, 0>::const_reverse_iterator
 An iterator for iteration through the array in reverse order that treats the elements as const.
 
using difference_type
 The type for the distance between two iterators.
 
using difference_type = std::ptrdiff_t
 The type for the distance between two iterators.
 
using iterator
 An iterator for the array.
 
using iterator = typename span<T, 0>::iterator
 An iterator for the array.
 
using pointer
 The type of a pointer to an array element.
 
using pointer = T*
 The type of a pointer to an array element.
 
using reference
 The type of a reference to an array element.
 
using reference = T&
 The type of a reference to an array element.
 
using reverse_iterator
 An iterator for iteration through the array in reverse order.
 
using reverse_iterator = typename span<T, 0>::reverse_iterator
 An iterator for iteration through the array in reverse order.
 
using size_type
 The type returned by size()
 
using size_type = std::size_t
 The type returned by size()
 
using value_type
 The type of each array element.
 
using value_type = T
 The type of each array element.
 

Public Member Functions

constexpr auto at (std::size_t index) -> T &
 Get a reference to the n'th element of the array, or throw.
 
constexpr auto at (std::size_t index) const -> T const &
 Get a reference to the n'th element of the array, or throw.
 
template<bool AreExceptionsEnabled = detail::are_exceptions_enabled::value, constraints< std::enable_if_t< AreExceptionsEnabled > > = nullptr>
ARENE_NORETURN constexpr auto at (std::size_t) -> T &
 Get a reference to the index'th element of the array.
 
template<bool AreExceptionsEnabled = detail::are_exceptions_enabled::value, constraints< std::enable_if_t< AreExceptionsEnabled > > = nullptr>
ARENE_NORETURN constexpr auto at (std::size_t) const -> T const &
 Get a const-reference to the index'th element of the array.
 
constexpr auto back () const noexcept -> T const &
 Get a const-reference to the last element of the array.
 
ARENE_NORETURN constexpr auto back () const noexcept -> T const &
 Get a const-reference to the last element of the array.
 
constexpr auto back () noexcept -> T &
 Get a const-reference to the last element of the array.
 
ARENE_NORETURN constexpr auto back () noexcept -> T &
 Get a const-reference to the last element of the array.
 
constexpr auto begin () const noexcept -> const_iterator
 Obtain an iterator to the first element of the array.
 
constexpr auto begin () const noexcept -> const_iterator
 Get a const_iterator that references the first element of the array.
 
constexpr auto begin () noexcept -> iterator
 Obtain an iterator to the first element of the array.
 
constexpr auto begin () noexcept -> iterator
 Get an iterator that references the first element of the array.
 
constexpr auto cbegin () const noexcept -> const_iterator
 Obtain a const_iterator that references the first element of the array.
 
constexpr auto cend () const noexcept -> const_iterator
 Obtain a const_iterator that references one past the last element of the array.
 
constexpr auto crbegin () const noexcept -> const_reverse_iterator
 Obtain a const_reverse_iterator that references the last element of the array.
 
constexpr auto crend () const noexcept -> const_reverse_iterator
 Obtain a const_reverse_iterator that references one before the first element of the array.
 
constexpr auto data () const noexcept -> T const *
 Obtain a pointer to the first element of the array.
 
constexpr auto data () const noexcept -> T const *
 Get a pointer to the first element of the const array.
 
constexpr auto data () noexcept -> T *
 Obtain a pointer to the first element of the array.
 
constexpr auto data () noexcept -> T *
 Get a pointer to the first element of the array.
 
constexpr auto end () const noexcept -> const_iterator
 Obtain an iterator to the one-passed-the-end of the array.
 
constexpr auto end () const noexcept -> const_iterator
 Get a const_iterator that references one past the last element of the array.
 
constexpr auto end () noexcept -> iterator
 Obtain an iterator to the one-passed-the-end of the array.
 
constexpr auto end () noexcept -> iterator
 Get an iterator that references one-past the last element of the array.
 
constexpr void fill (T const &val) noexcept(std::is_nothrow_copy_assignable< T >::value)
 Set every element in the array to the provided value.
 
constexpr auto front () const noexcept -> T const &
 Get a const-reference to the first element of the array.
 
ARENE_NORETURN constexpr auto front () const noexcept -> T const &
 Get a const-reference to the first element of the array.
 
constexpr auto front () noexcept -> T &
 Get a reference to the first element of the array.
 
ARENE_NORETURN constexpr auto front () noexcept -> T &
 Get a const-reference to the first element of the array.
 
constexpr auto operator[] (std::size_t index) const noexcept -> T const &
 Get a reference to the n'th element of the array.
 
constexpr auto operator[] (std::size_t index) noexcept -> T &
 Get a reference to the n'th element of the array.
 
constexpr auto rbegin () const noexcept -> const_reverse_iterator
 Obtain a reverse_iterator to the last element of the array.
 
constexpr auto rbegin () const noexcept -> const_reverse_iterator
 Get a const_reverse_iterator that references the last element of the array.
 
constexpr auto rbegin () noexcept -> reverse_iterator
 Obtain a reverse_iterator to the last element of the array.
 
constexpr auto rbegin () noexcept -> reverse_iterator
 Get an reverse_iterator that references the last element of the array.
 
constexpr auto rend () const noexcept -> const_reverse_iterator
 Obtai a const_reverse_iterator that references one before the first element of the array.
 
constexpr auto rend () const noexcept -> const_reverse_iterator
 Get a const_reverse_iterator that references one before the first element of the array.
 
constexpr auto rend () noexcept -> reverse_iterator
 Obtain a reverse_iterator that references one-before the first element of the array.
 
constexpr auto rend () noexcept -> reverse_iterator
 Get an reverse_iterator that references one-before the first element of the array.
 
constexpr void swap (array &) noexcept
 Swap all the elements with another array. This is a noop for an empty array.
 
constexpr void swap (array &other) noexcept(is_nothrow_swappable_v< U >)
 swaps all the elements this array and another.
 
ARENE_NORETURN constexpr auto operator[] (std::size_t) noexcept -> T &
 Get a reference to the index'th element of the array.
 
ARENE_NORETURN constexpr auto operator[] (std::size_t) const noexcept -> T const &
 Get a reference to the index'th element of the array.
 

Static Public Member Functions

static constexpr auto cbegin () noexcept -> const_iterator
 Get a const_iterator that references the first element of the array.
 
static constexpr auto cend () noexcept -> const_iterator
 Get a const_iterator that references one past the last element of the array.
 
static constexpr auto crbegin () noexcept -> const_reverse_iterator
 Get a const_reverse_iterator that references the last element of the array.
 
static constexpr auto crend () noexcept -> const_reverse_iterator
 Get a const_reverse_iterator that references one before the first element of the array.
 
static constexpr auto fast_inequality_check (array const &lhs, array< T, UN > const &rhs) noexcept -> arene::base::inequality_heuristic
 Quickly checks two arrays for inequality to see if a more costly full ordering check is needed.
 
static constexpr void fill (T const &) noexcept
 Set every element in the array to the provided value. This is a noop for an empty array.
 
static constexpr auto three_way_compare (array const &lhs, array< T, UN > const &rhs) noexcept -> arene::base::strong_ordering
 Imparts a lexicographic ordering of two arrays.
 
static constexpr auto three_way_compare (array const &, array< T, 0 > const &) noexcept -> arene::base::strong_ordering
 Imparts a lexicographic ordering of two arrays.
 

Public Attributes

values_ [N]
 The actual elements of the array object. This must be a public member to allow aggregate initialization, but users should treat it as private, and only use the documented public interface.
 

Static Public Attributes

static constexpr std::integral_constant< bool, false > empty
 Check if the array is empty, always false.
 
static constexpr std::integral_constant< bool, true > empty {}
 Check if the array is empty, always true.
 
static constexpr std::integral_constant< std::size_t, N > max_size
 The maximum number of elements in the array, which is always N.
 
static constexpr std::integral_constant< std::size_t, 0 > max_size {}
 The maximum number of elements in the array, which is always 0.
 
static constexpr std::integral_constant< std::size_t, N > size
 The number of elements in the array, which is always N.
 
static constexpr std::integral_constant< std::size_t, 0 > size {}
 The number of elements in the array, which is always 0.
 

Friends

constexpr auto operator!= (array const &lhs, array< T, UN > const &rhs) noexcept -> bool
 Inequality compare all elements in the array.
 
constexpr void swap (array &, array &) noexcept
 Swap all the elements with another array. This is a noop for an empty array.
 
constexpr void swap (array &lhs, array &rhs) noexcept(noexcept(lhs.swap(rhs)))
 swaps all the elements between two arrays.
 
constexpr auto operator== (array const &lhs, array const &rhs) noexcept -> bool
 Equality compare all elements in the array.
 
constexpr auto operator== (array const &, array< T, UN > const &) noexcept -> bool
 Equality compare all elements in the array.
 
constexpr auto operator== (array const &lhs, array const &rhs) noexcept -> bool
 Equality compare all elements in the array.
 
constexpr auto operator== (array const &lhs, array const &rhs) noexcept -> bool
 Equality compare all elements in the array.
 
constexpr auto operator== (array const &, array< T, UN > const &) noexcept -> bool
 Equality compare all elements in the array.
 
constexpr auto operator< (array const &lhs, array< T, UN > const &rhs) noexcept -> bool
 Imparts a lexicographic ordering of two arrays.
 
constexpr auto operator<= (array const &lhs, array< T, UN > const &rhs) noexcept -> bool
 Imparts a lexicographic ordering of two arrays.
 
constexpr auto operator> (array const &lhs, array< T, UN > const &rhs) noexcept -> bool
 Imparts a lexicographic ordering of two arrays.
 
constexpr auto operator>= (array const &lhs, array< T, UN > const &rhs) noexcept -> bool
 Imparts a lexicographic ordering of two arrays.
 
template<std::size_t UN>
static constexpr auto three_way_compare (array const &, array< T, UN > const &) noexcept -> arene::base::strong_ordering
 Compares two arrays lexicographically.
 
template<std::size_t UN>
constexpr auto operator== (array const &lhs, array< T, UN > const &rhs) noexcept -> bool
 Compares two arrays lexicographically.
 
template<std::size_t UN>
constexpr auto operator!= (array const &lhs, array< T, UN > const &rhs) noexcept -> bool
 Compares two arrays lexicographically.
 
template<std::size_t UN>
constexpr auto operator< (array const &lhs, array< T, UN > const &rhs) noexcept -> bool
 Compares two arrays lexicographically.
 
template<std::size_t UN>
constexpr auto operator<= (array const &lhs, array< T, UN > const &rhs) noexcept -> bool
 Compares two arrays lexicographically.
 
template<std::size_t UN>
constexpr auto operator> (array const &lhs, array< T, UN > const &rhs) noexcept -> bool
 Compares two arrays lexicographically.
 
template<std::size_t UN>
constexpr auto operator>= (array const &lhs, array< T, UN > const &rhs) noexcept -> bool
 Compares two arrays lexicographically.
 

Detailed Description

template<typename T>
class arene::base::array< T, 0 >

Specialize for zero-sized arrays as 'T array[0]' is not standards compliant.

See also
arene::base::array

Member Typedef Documentation

◆ const_iterator [1/2]

using arene::base::array< T, N >::const_iterator

An iterator for the array that treats the elements as const.

◆ const_iterator [2/2]

template<typename T>
using arene::base::array< T, 0 >::const_iterator = typename span<T const, 0>::iterator

An iterator for the array that treats the elements as const.

◆ const_pointer [1/2]

using arene::base::array< T, N >::const_pointer

The type of a pointer to a const array element.

◆ const_pointer [2/2]

template<typename T>
using arene::base::array< T, 0 >::const_pointer = T const*

The type of a pointer to a const array element.

◆ const_reference [1/2]

using arene::base::array< T, N >::const_reference

The type of a reference to a const array element.

◆ const_reference [2/2]

template<typename T>
using arene::base::array< T, 0 >::const_reference = T const&

The type of a reference to a const array element.

◆ const_reverse_iterator [1/2]

using arene::base::array< T, N >::const_reverse_iterator

An iterator for iteration through the array in reverse order that treats the elements as const.

◆ const_reverse_iterator [2/2]

template<typename T>
using arene::base::array< T, 0 >::const_reverse_iterator = typename span<T, 0>::const_reverse_iterator

An iterator for iteration through the array in reverse order that treats the elements as const.

◆ difference_type [1/2]

using arene::base::array< T, N >::difference_type

The type for the distance between two iterators.

◆ difference_type [2/2]

template<typename T>
using arene::base::array< T, 0 >::difference_type = std::ptrdiff_t

The type for the distance between two iterators.

◆ iterator [1/2]

using arene::base::array< T, N >::iterator

An iterator for the array.

◆ iterator [2/2]

template<typename T>
using arene::base::array< T, 0 >::iterator = typename span<T, 0>::iterator

An iterator for the array.

◆ pointer [1/2]

using arene::base::array< T, N >::pointer

The type of a pointer to an array element.

◆ pointer [2/2]

template<typename T>
using arene::base::array< T, 0 >::pointer = T*

The type of a pointer to an array element.

◆ reference [1/2]

using arene::base::array< T, N >::reference

The type of a reference to an array element.

◆ reference [2/2]

template<typename T>
using arene::base::array< T, 0 >::reference = T&

The type of a reference to an array element.

◆ reverse_iterator [1/2]

using arene::base::array< T, N >::reverse_iterator

An iterator for iteration through the array in reverse order.

◆ reverse_iterator [2/2]

template<typename T>
using arene::base::array< T, 0 >::reverse_iterator = typename span<T, 0>::reverse_iterator

An iterator for iteration through the array in reverse order.

◆ size_type [1/2]

using arene::base::array< T, N >::size_type

The type returned by size()

◆ size_type [2/2]

template<typename T>
using arene::base::array< T, 0 >::size_type = std::size_t

The type returned by size()

◆ value_type [1/2]

using arene::base::array< T, N >::value_type

The type of each array element.

◆ value_type [2/2]

template<typename T>
using arene::base::array< T, 0 >::value_type = T

The type of each array element.

Member Function Documentation

◆ at() [1/4]

auto arene::base::array< T, N >::at ( std::size_t index) -> T&
inlineconstexpr

Get a reference to the n'th element of the array, or throw.

Template Parameters
AreExceptionsEnabledSFINAE flag to disable this method if exceptions are not enabled. Should not be specified by the user.
Parameters
indexThe index of the element to access.
Returns
A reference to that element
Exceptions
std::out_of_rangeIf index is not less than N

◆ at() [2/4]

auto arene::base::array< T, N >::at ( std::size_t index) const-> T const&
inlineconstexpr

Get a reference to the n'th element of the array, or throw.

Template Parameters
AreExceptionsEnabledDefaulted SFINAE flag to disable this method if exceptions are not enabled; should not be specified by user.
Parameters
indexThe index of the element to access.
Returns
A reference to that element
Exceptions
std::out_of_rangeIf index is not less than N

◆ at() [3/4]

template<typename T>
template<bool AreExceptionsEnabled = detail::are_exceptions_enabled::value, constraints< std::enable_if_t< AreExceptionsEnabled > > = nullptr>
ARENE_NORETURN constexpr auto arene::base::array< T, 0 >::at ( std::size_t ) -> T&
inlineconstexpr

Get a reference to the index'th element of the array.

Template Parameters
AreExceptionsEnabledDefaulted SFINAE flag to disable this method if exceptions are not enabled; should not be specified by user.
Returns
Never returns
Exceptions
std::out_of_rangeunconditionally

◆ at() [4/4]

template<typename T>
template<bool AreExceptionsEnabled = detail::are_exceptions_enabled::value, constraints< std::enable_if_t< AreExceptionsEnabled > > = nullptr>
ARENE_NORETURN constexpr auto arene::base::array< T, 0 >::at ( std::size_t ) const -> T const&
inlineconstexpr

Get a const-reference to the index'th element of the array.

Template Parameters
AreExceptionsEnabledDefaulted SFINAE flag to disable this method if exceptions are not enabled; should not be specified by user.
Returns
Never returns
Exceptions
std::out_of_range

◆ back() [1/4]

auto arene::base::array< T, N >::back ( ) const -> T const&
inlineconstexprnoexcept

Get a const-reference to the last element of the array.

Returns
A reference to the last element

◆ back() [2/4]

template<typename T>
ARENE_NORETURN constexpr auto arene::base::array< T, 0 >::back ( ) const -> T const&
inlineconstexprnoexcept

Get a const-reference to the last element of the array.

Returns
A reference to the last element

◆ back() [3/4]

auto arene::base::array< T, N >::back ( ) -> T&
inlineconstexprnoexcept

Get a const-reference to the last element of the array.

Returns
A reference to the last element

◆ back() [4/4]

template<typename T>
ARENE_NORETURN constexpr auto arene::base::array< T, 0 >::back ( ) -> T&
inlineconstexprnoexcept

Get a const-reference to the last element of the array.

Returns
A reference to the last element

◆ begin() [1/4]

auto arene::base::array< T, N >::begin ( ) const -> const_iterator
inlineconstexprnoexcept

Obtain an iterator to the first element of the array.

Returns
a const_iterator that references the first element of the array.

◆ begin() [2/4]

template<typename T>
auto arene::base::array< T, 0 >::begin ( ) const -> const_iterator
inlineconstexprnoexcept

Get a const_iterator that references the first element of the array.

Returns
The iterator

◆ begin() [3/4]

auto arene::base::array< T, N >::begin ( ) -> iterator
inlineconstexprnoexcept

Obtain an iterator to the first element of the array.

Returns
an iterator that references the first element of the array.

◆ begin() [4/4]

template<typename T>
auto arene::base::array< T, 0 >::begin ( ) -> iterator
inlineconstexprnoexcept

Get an iterator that references the first element of the array.

Returns
The iterator

◆ cbegin() [1/2]

auto arene::base::array< T, N >::cbegin ( ) const -> const_iterator
inlineconstexprnoexcept

Obtain a const_iterator that references the first element of the array.

Returns
a const_iterator that references the first element of the array.

◆ cbegin() [2/2]

template<typename T>
static constexpr auto arene::base::array< T, 0 >::cbegin ( ) -> const_iterator
inlinestaticconstexprnoexcept

Get a const_iterator that references the first element of the array.

Returns
The iterator

◆ cend() [1/2]

auto arene::base::array< T, N >::cend ( ) const -> const_iterator
inlineconstexprnoexcept

Obtain a const_iterator that references one past the last element of the array.

Returns
a const_iterator that references one past the last element of the array.

◆ cend() [2/2]

template<typename T>
static constexpr auto arene::base::array< T, 0 >::cend ( ) -> const_iterator
inlinestaticconstexprnoexcept

Get a const_iterator that references one past the last element of the array.

Returns
The iterator

◆ crbegin() [1/2]

auto arene::base::array< T, N >::crbegin ( ) const -> const_reverse_iterator
inlineconstexprnoexcept

Obtain a const_reverse_iterator that references the last element of the array.

Returns
a const_reverse_iterator that references the last element of the array.

◆ crbegin() [2/2]

template<typename T>
static constexpr auto arene::base::array< T, 0 >::crbegin ( ) -> const_reverse_iterator
inlinestaticconstexprnoexcept

Get a const_reverse_iterator that references the last element of the array.

Returns
The iterator

◆ crend() [1/2]

auto arene::base::array< T, N >::crend ( ) const -> const_reverse_iterator
inlineconstexprnoexcept

Obtain a const_reverse_iterator that references one before the first element of the array.

Returns
a const_reverse_iterator that references one before the first element of the array.

◆ crend() [2/2]

template<typename T>
static constexpr auto arene::base::array< T, 0 >::crend ( ) -> const_reverse_iterator
inlinestaticconstexprnoexcept

Get a const_reverse_iterator that references one before the first element of the array.

Returns
The iterator

◆ data() [1/4]

auto arene::base::array< T, N >::data ( ) const -> T const*
inlineconstexprnoexcept

Obtain a pointer to the first element of the array.

Returns
a pointer to the first element of the array, const-qualified.

◆ data() [2/4]

template<typename T>
auto arene::base::array< T, 0 >::data ( ) const -> T const*
inlineconstexprnoexcept

Get a pointer to the first element of the const array.

Returns
A null pointer

◆ data() [3/4]

auto arene::base::array< T, N >::data ( ) -> T*
inlineconstexprnoexcept

Obtain a pointer to the first element of the array.

Returns
a pointer to the first element of the array.

◆ data() [4/4]

template<typename T>
auto arene::base::array< T, 0 >::data ( ) -> T*
inlineconstexprnoexcept

Get a pointer to the first element of the array.

Returns
A null pointer

◆ end() [1/4]

auto arene::base::array< T, N >::end ( ) const -> const_iterator
inlineconstexprnoexcept

Obtain an iterator to the one-passed-the-end of the array.

Returns
a const_iterator that references one past the last element of the array.

◆ end() [2/4]

template<typename T>
auto arene::base::array< T, 0 >::end ( ) const -> const_iterator
inlineconstexprnoexcept

Get a const_iterator that references one past the last element of the array.

Returns
The iterator

◆ end() [3/4]

auto arene::base::array< T, N >::end ( ) -> iterator
inlineconstexprnoexcept

Obtain an iterator to the one-passed-the-end of the array.

Returns
an iterator that references one-past the last element of the array.

◆ end() [4/4]

template<typename T>
auto arene::base::array< T, 0 >::end ( ) -> iterator
inlineconstexprnoexcept

Get an iterator that references one-past the last element of the array.

Returns
The iterator

◆ fast_inequality_check()

static constexpr auto arene::base::array< T, N >::fast_inequality_check ( array< T, 0 > const & lhs,
array< T, UN > const & rhs )-> arene::base::inequality_heuristic
inlinestaticconstexprnoexcept

Quickly checks two arrays for inequality to see if a more costly full ordering check is needed.

Parameters
lhsone of the arrays to compare
rhsthe other array to compare
Returns
arene::base::inequality_heuristic::definitely_not_equal if the two arrays have different sizes or if any pair of their elements compare definitely_not_equal
arene::base::inequality_heuristic::may_be_equal_or_not_equal otherwise

◆ fill() [1/2]

template<typename T>
static constexpr void arene::base::array< T, 0 >::fill ( T const & )
inlinestaticconstexprnoexcept

Set every element in the array to the provided value. This is a noop for an empty array.

◆ fill() [2/2]

void arene::base::array< T, N >::fill ( T const & val)
inlineconstexprnoexcept

Set every element in the array to the provided value.

Parameters
valThe value to use

◆ front() [1/4]

auto arene::base::array< T, N >::front ( ) const -> T const&
inlineconstexprnoexcept

Get a const-reference to the first element of the array.

Returns
A reference to the first element

◆ front() [2/4]

template<typename T>
ARENE_NORETURN constexpr auto arene::base::array< T, 0 >::front ( ) const -> T const&
inlineconstexprnoexcept

Get a const-reference to the first element of the array.

Returns
A reference to the first element

◆ front() [3/4]

auto arene::base::array< T, N >::front ( ) -> T&
inlineconstexprnoexcept

Get a reference to the first element of the array.

Returns
A reference to the first element

◆ front() [4/4]

template<typename T>
ARENE_NORETURN constexpr auto arene::base::array< T, 0 >::front ( ) -> T&
inlineconstexprnoexcept

Get a const-reference to the first element of the array.

Returns
A reference to the first element

◆ operator[]() [1/4]

auto arene::base::array< T, N >::operator[] ( std::size_t index) const-> T const&
inlineconstexprnoexcept

Get a reference to the n'th element of the array.

Parameters
indexThe index of the element to access.
Precondition
index Must be less than N or else ARENE_PRECONDITION violation.
Returns
A reference to that element

◆ operator[]() [2/4]

auto arene::base::array< T, N >::operator[] ( std::size_t index) -> T&
inlineconstexprnoexcept

Get a reference to the n'th element of the array.

Parameters
indexThe index of the element to access.
Precondition
index Must be less than N or else ARENE_PRECONDITION violation.
Returns
A reference to that element

◆ operator[]() [3/4]

template<typename T>
ARENE_NORETURN constexpr auto arene::base::array< T, 0 >::operator[] ( std::size_t ) const -> T const&
inlineconstexprnoexcept

Get a reference to the index'th element of the array.

Returns
Never returns
Invariant
Will always trigger ARENE_PRECONDITION

◆ operator[]() [4/4]

template<typename T>
ARENE_NORETURN constexpr auto arene::base::array< T, 0 >::operator[] ( std::size_t ) -> T&
inlineconstexprnoexcept

Get a reference to the index'th element of the array.

Returns
Never returns
Invariant
Will always trigger ARENE_PRECONDITION

◆ rbegin() [1/4]

auto arene::base::array< T, N >::rbegin ( ) const -> const_reverse_iterator
inlineconstexprnoexcept

Obtain a reverse_iterator to the last element of the array.

Returns
a const_reverse_iterator that references the last element of the array.

◆ rbegin() [2/4]

template<typename T>
auto arene::base::array< T, 0 >::rbegin ( ) const -> const_reverse_iterator
inlineconstexprnoexcept

Get a const_reverse_iterator that references the last element of the array.

Returns
The iterator

◆ rbegin() [3/4]

auto arene::base::array< T, N >::rbegin ( ) -> reverse_iterator
inlineconstexprnoexcept

Obtain a reverse_iterator to the last element of the array.

Returns
a reverse_iterator that references the last element of the array.

◆ rbegin() [4/4]

template<typename T>
auto arene::base::array< T, 0 >::rbegin ( ) -> reverse_iterator
inlineconstexprnoexcept

Get an reverse_iterator that references the last element of the array.

Returns
The iterator

◆ rend() [1/4]

auto arene::base::array< T, N >::rend ( ) const -> const_reverse_iterator
inlineconstexprnoexcept

Obtai a const_reverse_iterator that references one before the first element of the array.

Returns
a const_reverse_iterator that references one before the first element of the array.

◆ rend() [2/4]

template<typename T>
auto arene::base::array< T, 0 >::rend ( ) const -> const_reverse_iterator
inlineconstexprnoexcept

Get a const_reverse_iterator that references one before the first element of the array.

Returns
The iterator

◆ rend() [3/4]

auto arene::base::array< T, N >::rend ( ) -> reverse_iterator
inlineconstexprnoexcept

Obtain a reverse_iterator that references one-before the first element of the array.

Returns
a reverse_iterator that references one-before the first element of the array.

◆ rend() [4/4]

template<typename T>
auto arene::base::array< T, 0 >::rend ( ) -> reverse_iterator
inlineconstexprnoexcept

Get an reverse_iterator that references one-before the first element of the array.

Returns
The iterator

◆ swap() [1/2]

template<typename T>
void arene::base::array< T, 0 >::swap ( array< T, 0 > & )
inlineconstexprnoexcept

Swap all the elements with another array. This is a noop for an empty array.

◆ swap() [2/2]

void arene::base::array< T, N >::swap ( array< T, 0 > & other)
inlineconstexprnoexcept

swaps all the elements this array and another.

Template Parameters
Uthe type of the elements in the array. Must satisfy is_swappable_v .
Parameters
otherthe array to swap elements with
Postcondition
The elements in this array and other are exchanged 1:1. Relative order is maintained.

◆ three_way_compare() [1/3]

static constexpr auto arene::base::array< T, N >::three_way_compare ( array< T, 0 > const & ,
array< T, 0 > const &  )-> arene::base::strong_ordering
inlinestaticconstexprnoexcept

Imparts a lexicographic ordering of two arrays.

Parameters
lhsone of the arrays to compare
rhsthe other array to compare
Returns
arene::base::strong_ordering::less if the first element which compares unequal between rhs and lhs also compares less-than, or if lhs is a strict prefix of rhs.
arene::base::strong_ordering::equal if all elements compare equal.
arene::base::strong_ordering::greater if the first element which compares unequal between rhs and lhs also compares greater, or if rhs is a strict prefix of lhs.

◆ three_way_compare() [2/3]

template<typename T>
template<std::size_t UN>
static constexpr auto arene::base::array< T, 0 >::three_way_compare ( array< T, 0 > const & ,
array< T, UN > const &  ) -> arene::base::strong_ordering
inlinestaticconstexprnoexcept

Compares two arrays lexicographically.

Parameters
lhsThe left hand operand to the comparison.
rhsThe right hand operand to the comparison.
Returns
The equivalent of compare_three_way{}(0U,UN)

◆ three_way_compare() [3/3]

static constexpr auto arene::base::array< T, N >::three_way_compare ( array< T, 0 > const & lhs,
array< T, UN > const & rhs )-> arene::base::strong_ordering
inlinestaticconstexprnoexcept

Imparts a lexicographic ordering of two arrays.

Parameters
lhsone of the arrays to compare
rhsthe other array to compare
Returns
arene::base::strong_ordering::less if the first element which compares unequal between rhs and lhs also compares less-than, or if lhs is a strict prefix of rhs.
arene::base::strong_ordering::equal if all elements compare equal.
arene::base::strong_ordering::greater if the first element which compares unequal between rhs and lhs also compares greater, or if rhs is a strict prefix of lhs.

Friends And Related Symbol Documentation

◆ operator!= [1/2]

auto operator!= ( array< T, 0 > const & lhs,
array< T, UN > const & rhs )-> bool
friend

Inequality compare all elements in the array.

Parameters
lhsone of the arrays to compare
rhsthe other array to compare
Returns
true if any elements in the arrays are not equal, or the sizes of the arrays are different.
false if all elements in the arrays are equal.

◆ operator!= [2/2]

template<typename T>
template<std::size_t UN>
auto operator!= ( array< T, 0 > const & lhs,
array< T, UN > const & rhs ) -> bool
friend

Compares two arrays lexicographically.

Parameters
lhsThe left hand operand to the comparison.
rhsThe right hand operand to the comparison.
Returns
The equivalent of compare_three_way{}(0U,UN)

◆ operator< [1/2]

auto operator< ( array< T, 0 > const & lhs,
array< T, UN > const & rhs )-> bool
friend

Imparts a lexicographic ordering of two arrays.

Parameters
lhsone of the arrays to compare
rhsthe other array to compare
See also
arene::base::array<T,N>::three_way_compare .

◆ operator< [2/2]

template<typename T>
template<std::size_t UN>
auto operator< ( array< T, 0 > const & lhs,
array< T, UN > const & rhs ) -> bool
friend

Compares two arrays lexicographically.

Parameters
lhsThe left hand operand to the comparison.
rhsThe right hand operand to the comparison.
Returns
The equivalent of compare_three_way{}(0U,UN)

◆ operator<= [1/2]

auto operator<= ( array< T, 0 > const & lhs,
array< T, UN > const & rhs )-> bool
friend

Imparts a lexicographic ordering of two arrays.

Parameters
lhsone of the arrays to compare
rhsthe other array to compare
See also
arene::base::array<T,N>::three_way_compare .

◆ operator<= [2/2]

template<typename T>
template<std::size_t UN>
auto operator<= ( array< T, 0 > const & lhs,
array< T, UN > const & rhs ) -> bool
friend

Compares two arrays lexicographically.

Parameters
lhsThe left hand operand to the comparison.
rhsThe right hand operand to the comparison.
Returns
The equivalent of compare_three_way{}(0U,UN)

◆ operator== [1/6]

auto operator== ( array< T, 0 > const & ,
array< T, UN > const &  )-> bool
friend

Equality compare all elements in the array.

Parameters
lhsone of the arrays to compare
rhsthe other array to compare
Returns
true if all elements in the arrays are equal.
false if any elements in the arrays are not equal, or the sizes of the arrays are different.

◆ operator== [2/6]

auto operator== ( array< T, 0 > const & ,
array< T, UN > const &  )-> bool
friend

Equality compare all elements in the array.

Parameters
lhsone of the arrays to compare
rhsthe other array to compare
Returns
true if all elements in the arrays are equal.
false if any elements in the arrays are not equal, or the sizes of the arrays are different.

◆ operator== [3/6]

auto operator== ( array< T, 0 > const & lhs,
array< T, 0 > const & rhs )-> bool
friend

Equality compare all elements in the array.

Parameters
lhsone of the arrays to compare
rhsthe other array to compare
Returns
true if all elements in the arrays are equal.
false if any elements in the arrays are not equal, or the sizes of the arrays are different.

◆ operator== [4/6]

auto operator== ( array< T, 0 > const & lhs,
array< T, 0 > const & rhs )-> bool
friend

Equality compare all elements in the array.

Parameters
lhsone of the arrays to compare
rhsthe other array to compare
Returns
true if all elements in the arrays are equal.
false if any elements in the arrays are not equal, or the sizes of the arrays are different.

◆ operator== [5/6]

auto operator== ( array< T, 0 > const & lhs,
array< T, 0 > const & rhs )-> bool
friend

Equality compare all elements in the array.

Parameters
lhsone of the arrays to compare
rhsthe other array to compare
Returns
true if all elements in the arrays are equal.
false if any elements in the arrays are not equal, or the sizes of the arrays are different.

◆ operator== [6/6]

template<typename T>
template<std::size_t UN>
auto operator== ( array< T, 0 > const & lhs,
array< T, UN > const & rhs ) -> bool
friend

Compares two arrays lexicographically.

Parameters
lhsThe left hand operand to the comparison.
rhsThe right hand operand to the comparison.
Returns
The equivalent of compare_three_way{}(0U,UN)

◆ operator> [1/2]

auto operator> ( array< T, 0 > const & lhs,
array< T, UN > const & rhs )-> bool
friend

Imparts a lexicographic ordering of two arrays.

Parameters
lhsone of the arrays to compare
rhsthe other array to compare
See also
arene::base::array<T,N>::three_way_compare .

◆ operator> [2/2]

template<typename T>
template<std::size_t UN>
auto operator> ( array< T, 0 > const & lhs,
array< T, UN > const & rhs ) -> bool
friend

Compares two arrays lexicographically.

Parameters
lhsThe left hand operand to the comparison.
rhsThe right hand operand to the comparison.
Returns
The equivalent of compare_three_way{}(0U,UN)

◆ operator>= [1/2]

auto operator>= ( array< T, 0 > const & lhs,
array< T, UN > const & rhs )-> bool
friend

Imparts a lexicographic ordering of two arrays.

Parameters
lhsone of the arrays to compare
rhsthe other array to compare
See also
arene::base::array<T,N>::three_way_compare .

◆ operator>= [2/2]

template<typename T>
template<std::size_t UN>
auto operator>= ( array< T, 0 > const & lhs,
array< T, UN > const & rhs ) -> bool
friend

Compares two arrays lexicographically.

Parameters
lhsThe left hand operand to the comparison.
rhsThe right hand operand to the comparison.
Returns
The equivalent of compare_three_way{}(0U,UN)

◆ swap [1/2]

template<typename T>
void swap ( array< T, 0 > & ,
array< T, 0 > &  )
friend

Swap all the elements with another array. This is a noop for an empty array.

◆ swap [2/2]

void swap ( array< T, 0 > & lhs,
array< T, 0 > & rhs )
friend

swaps all the elements between two arrays.

Template Parameters
Uthe type of the elements in the array. Must satisfy is_swappable_v .
Parameters
lhsthe left hand array to swap.
rhsthe right hand array to swap.
Postcondition
The elements in lhs and rhs are exchanged 1:1. Relative order is maintained.

Member Data Documentation

◆ empty [1/2]

std::integral_constant<bool, false> arene::base::array< T, N >::empty
staticconstexpr

Check if the array is empty, always false.

Returns
false

◆ empty [2/2]

template<typename T>
std::integral_constant<bool, true> arene::base::array< T, 0 >::empty {}
staticconstexpr

Check if the array is empty, always true.

Returns
true

◆ max_size [1/2]

std::integral_constant<std::size_t, N> arene::base::array< T, N >::max_size
staticconstexpr

The maximum number of elements in the array, which is always N.

Returns
The size of the array, N

◆ max_size [2/2]

template<typename T>
std::integral_constant<std::size_t, 0> arene::base::array< T, 0 >::max_size {}
staticconstexpr

The maximum number of elements in the array, which is always 0.

Returns
The size of the array, 0

◆ size [1/2]

std::integral_constant<std::size_t, N> arene::base::array< T, N >::size
staticconstexpr

The number of elements in the array, which is always N.

Returns
The size of the array, N

◆ size [2/2]

template<typename T>
std::integral_constant<std::size_t, 0> arene::base::array< T, 0 >::size {}
staticconstexpr

The number of elements in the array, which is always 0.

Returns
The size of the array, 0

◆ values_

T arene::base::array< T, N >::values_[N]

The actual elements of the array object. This must be a public member to allow aggregate initialization, but users should treat it as private, and only use the documented public interface.


The documentation for this class was generated from the following file: