SpECTRE  v2022.05.05
cpp20::array< T, Size > Struct Template Reference

A std::array implementation with partial C++20 support. More...

#include <Array.hpp>

Public Types

using value_type = T
using reference = value_type &
using const_reference = const value_type &
using iterator = value_type *
using const_iterator = const value_type *
using pointer = value_type *
using const_pointer = const value_type *
using size_type = size_t
using difference_type = std::ptrdiff_t

Public Member Functions

constexpr iterator begin ()
constexpr const_iterator begin () const
constexpr iterator end ()
constexpr const_iterator end () const
constexpr const_iterator cbegin () const
constexpr const_iterator cend () const
constexpr size_type size () const
constexpr size_type max_size () const
constexpr bool empty () const
constexpr reference operator[] (const size_type i)
constexpr const_reference operator[] (const size_type i) const
constexpr reference at (const size_type i)
constexpr const_reference at (const size_type i) const
constexpr reference front ()
constexpr const_reference front () const
constexpr reference back ()
constexpr const_reference back () const
constexpr value_type * data ()
constexpr const value_type * data () const

Public Attributes

value_type data_ [Size > 0 ? Size :1]

Detailed Description

template<typename T, size_t Size>
struct cpp20::array< T, Size >

A std::array implementation with partial C++20 support.

This is not a standard-compliant C++20 std::array implementation. We provide this implementation because we need the constexpr operator== from C++20. Note that other C++20 changes, such as the replacement of the other comparison operators in favor of operator<=>, are not implemented. This class can be removed when we support C++20.

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