array_ref.h#
-
namespace ONNX_LIGHT_NAMESPACE
-
template<typename T>
class ArrayRef# - #include <array_ref.h>
Represents a non-owning view over a contiguous sequence of elements.
The referenced storage must outlive the ArrayRef instance.
Public Types
-
using size_type = size_t#
Public Functions
-
inline ArrayRef()#
Constructs an empty reference.
-
inline ArrayRef(const T *data, size_t length)#
Constructs a reference from a pointer and explicit length.
-
inline ArrayRef(const T *begin, const T *end)#
Constructs a reference from a half-open pointer range [begin, end).
-
template<typename A>
inline ArrayRef(const std::vector<T, A> &vec)# Constructs an ArrayRef from a vector.
-
template<size_t N>
inline constexpr ArrayRef(const std::array<T, N> &arr)# Constructs an ArrayRef from a fixed-size std::array.
-
template<size_t N>
inline constexpr ArrayRef(const T (&arr)[N])# Constructs an ArrayRef from a C array.
-
inline ArrayRef(const std::initializer_list<T> &vec)#
Constructs an ArrayRef from an initializer list.
-
inline reverse_iterator rbegin() const#
Returns a reverse iterator to the beginning of the reversed range.
-
inline reverse_iterator rend() const#
Returns a reverse iterator to the end of the reversed range.
-
inline bool empty() const#
Returns true if the reference is empty.
-
inline size_t size() const#
Returns the number of elements.
-
inline ArrayRef<T> slice(size_t n, size_t m) const#
Returns a sub-reference starting at n with length m. Precondition: n + m <= size().
-
inline ArrayRef<T> slice(size_t n) const#
Returns a sub-reference starting at n until the end. Precondition: n <= size().
-
inline const T &operator[](size_t index) const#
Returns the element at index. Precondition: index is in range.
-
inline const T &at(size_t index) const#
Returns the element at index. Precondition: index is in range.
-
template<typename U>
std::enable_if_t<std::is_same_v<U, T>, ArrayRef<T>> &operator=(U &&temporary) = delete#
-
using size_type = size_t#
-
template<typename T>