21 #ifndef GF_ARRAY_REF_H 22 #define GF_ARRAY_REF_H 29 #ifndef DOXYGEN_SHOULD_SKIP_THIS 85 : m_data(values.data())
86 , m_size(values.size())
95 template<std::
size_t N>
97 : m_data(values.data())
98 , m_size(values.size())
109 template<std::
size_t N>
130 constexpr std::size_t
getSize() const noexcept {
150 assert(index <= m_size);
151 return ArrayRef<T>(m_data + index, m_size - index);
161 constexpr
const T *
begin() const noexcept {
172 constexpr
const T *
end() const noexcept {
173 return m_data + m_size;
185 return m_data[index];
209 #ifndef DOXYGEN_SHOULD_SKIP_THIS 214 #endif // GF_ARRAY_REF_H constexpr const T * getData() const noexcept
Get a pointer to the elements.
Definition: ArrayRef.h:121
constexpr ArrayRef(std::nullptr_t)
Null constructor.
Definition: ArrayRef.h:61
ArrayRef(const std::array< T, N > &values)
Constructor from a std::array
Definition: ArrayRef.h:96
constexpr ArrayRef< T > sub(std::size_t index)
Create an array starting at a specified index.
Definition: ArrayRef.h:149
constexpr ArrayRef()
Default constructor.
Definition: ArrayRef.h:50
constexpr const T & operator[](std::size_t index) const
Get an element at a given index.
Definition: ArrayRef.h:184
constexpr const T * end() const noexcept
Get an iterator past the last element.
Definition: ArrayRef.h:172
The namespace for gf classes.
Definition: Action.h:35
constexpr std::size_t getSize() const noexcept
Get the number of elements.
Definition: ArrayRef.h:130
A constant reference to an array and its size.
Definition: ArrayRef.h:43
ArrayRef(const std::vector< T > &values)
Constructor from a std::vector
Definition: ArrayRef.h:84
constexpr const T * begin() const noexcept
Get an iterator to the first element.
Definition: ArrayRef.h:161
constexpr bool isEmpty() const noexcept
Check if the array is empty.
Definition: ArrayRef.h:139
constexpr ArrayRef(const T(&data)[N])
Constructor from a static array.
Definition: ArrayRef.h:110
constexpr ArrayRef< T > array(const T *data, std::size_t size)
Create a constant reference to an array.
Definition: ArrayRef.h:204
constexpr ArrayRef(const T *data, std::size_t size)
Constructor from a pointer and a size.
Definition: ArrayRef.h:73