|
constexpr | StaticSpan () noexcept |
| Default constructor. More...
|
|
constexpr | StaticSpan (std::nullptr_t) noexcept |
| Null constructor. More...
|
|
constexpr | StaticSpan (T *data, std::size_t size) noexcept |
| Constructor from a pointer and a size. More...
|
|
template<typename U , typename = std::enable_if_t<std::is_convertible<U(*)[], T(*)[]>::value>> |
constexpr | StaticSpan (U(&data)[N]) noexcept |
| Constructor from a static array. More...
|
|
template<typename U , typename = std::enable_if_t<std::is_convertible<U(*)[], T(*)[]>::value>> |
constexpr | StaticSpan (std::array< U, N > &array) noexcept |
| Constructor from a std::array More...
|
|
template<typename U , typename = std::enable_if_t<std::is_convertible<U(*)[], T(*)[]>::value>> |
constexpr | StaticSpan (StaticSpan< U, N > other) noexcept |
| Constructor from another span. More...
|
|
constexpr T * | getData () noexcept |
| Get a pointer to the elements. More...
|
|
constexpr const T * | getData () const noexcept |
| Get a pointer to the elements. More...
|
|
constexpr std::size_t | getSize () const noexcept |
| Get the number of elements. More...
|
|
constexpr bool | isEmpty () const noexcept |
| Check if the array is empty. More...
|
|
constexpr T * | begin () noexcept |
| Get an iterator to the first element. More...
|
|
constexpr T * | end () noexcept |
| Get an iterator past the last element. More...
|
|
constexpr const T * | begin () const noexcept |
| Get an iterator to the first element. More...
|
|
constexpr const T * | end () const noexcept |
| Get an iterator past the last element. More...
|
|
constexpr T & | operator[] (std::size_t index) noexcept |
| Get an element at a given index. More...
|
|
constexpr const T & | operator[] (std::size_t index) const noexcept |
| Get an element at a given index. More...
|
|
template<std::size_t I> |
constexpr T & | get () noexcept |
| Get an element at a constant index. More...
|
|
template<std::size_t I> |
constexpr const T & | get () const noexcept |
| Get an element at a constant index. More...
|
|
constexpr Span< T > | slice (std::size_t b, std::size_t e) const noexcept |
| Take a sub-span. More...
|
|
template<std::size_t B, std::size_t E> |
constexpr StaticSpan< T, E - B > | slice () const noexcept |
| Take a constant sub-span. More...
|
|
constexpr Span< T > | first (std::size_t count) const noexcept |
| Take a span on the first objects. More...
|
|
template<std::size_t C> |
constexpr StaticSpan< T, C > | first () const noexcept |
| Take a constant span on the first objects. More...
|
|
constexpr Span< T > | last (std::size_t count) const noexcept |
| Take a span on the last objects. More...
|
|
template<std::size_t C> |
constexpr StaticSpan< T, C > | last () const noexcept |
| Take a constant span on the last objects. More...
|
|
constexpr Span< T > | firstExcept (std::size_t count) const noexcept |
| Take a span on the first objects. More...
|
|
template<std::size_t C> |
constexpr StaticSpan< T, Size - C > | firstExcept () const noexcept |
| Take a constant span on the first objects. More...
|
|
constexpr Span< T > | lastExcept (std::size_t count) const noexcept |
| Take a span on the last objects. More...
|
|
template<std::size_t C> |
constexpr StaticSpan< T, Size - C > | lastExcept () const noexcept |
| Take a constant span on the last objects. More...
|
|
template<typename T, std::size_t N>
class gf::StaticSpan< T, N >
A static span.
A span is a non-owning reference to a contiguous sequence of objects. A static span knows the number of objects at compile-time.
This class stores a pointer to some data. It can be built from various inputs: std::array
, static array, pointer and size.
- See also
- gf::Span