21 #ifndef GF_ARRAY_REF_H
22 #define GF_ARRAY_REF_H
27 #ifndef DOXYGEN_SHOULD_SKIP_THIS
61 constexpr ArrayRef(
const T *data, std::size_t size)
74 : m_data(values.data())
75 , m_size(values.size())
87 template<std::size_t N>
101 : m_data(values.size() == 0 ?
nullptr : values.begin())
102 , m_size(values.size())
143 constexpr const T *
end()
const {
144 return m_data + m_size;
153 #ifndef DOXYGEN_SHOULD_SKIP_THIS
constexpr std::size_t getSize() const
Get the number of elements.
Definition: ArrayRef.h:121
constexpr ArrayRef()
Default constructor.
Definition: ArrayRef.h:48
constexpr const T * getData() const
Get a pointer to the elements.
Definition: ArrayRef.h:112
ArrayRef(std::initializer_list< T > values)
Constructor from an initializer list.
Definition: ArrayRef.h:100
constexpr const T * begin() const
Get an iterator to the first element.
Definition: ArrayRef.h:132
A constant reference to an array and its size.
Definition: ArrayRef.h:41
ArrayRef(const std::vector< T > &values)
Constructor from a std::vector
Definition: ArrayRef.h:73
constexpr ArrayRef(const T(&data)[N])
Constructor from a static array.
Definition: ArrayRef.h:88
constexpr const T * end() const
Get an iterator past the last element.
Definition: ArrayRef.h:143
constexpr ArrayRef(const T *data, std::size_t size)
Constructor from a pointer and a size.
Definition: ArrayRef.h:61