SpECTRE  v2024.09.29
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
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 

Public Member Functions

KOKKOS_FUNCTION constexpr iterator begin ()
 
KOKKOS_FUNCTION constexpr const_iterator begin () const
 
KOKKOS_FUNCTION constexpr iterator end ()
 
KOKKOS_FUNCTION constexpr const_iterator end () const
 
KOKKOS_FUNCTION constexpr const_iterator cbegin () const
 
KOKKOS_FUNCTION constexpr const_iterator cend () const
 
KOKKOS_FUNCTION constexpr size_type size () const
 
KOKKOS_FUNCTION constexpr size_type max_size () const
 
KOKKOS_FUNCTION constexpr bool empty () const
 
KOKKOS_FUNCTION constexpr reference operator[] (const size_type i)
 
KOKKOS_FUNCTION constexpr const_reference operator[] (const size_type i) const
 
KOKKOS_FUNCTION constexpr reference at (const size_type i)
 
KOKKOS_FUNCTION constexpr const_reference at (const size_type i) const
 
KOKKOS_FUNCTION constexpr reference front ()
 
KOKKOS_FUNCTION constexpr const_reference front () const
 
KOKKOS_FUNCTION constexpr reference back ()
 
KOKKOS_FUNCTION constexpr const_reference back () const
 
KOKKOS_FUNCTION constexpr value_type * data ()
 
KOKKOS_FUNCTION 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.

Warning
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: