|
|
constexpr | span ()=default |
| | Makes a span of no elements.
|
| constexpr | span (T *data, size_type size) |
| | Makes a span of size elements from data on.
|
| template<size_t N> |
| constexpr | span (T(&elements)[N]) |
| | Makes a span of a C array, as a text in quotes is.
|
| template<typename Element, size_t N, typename = internal::IfPointerConverts<T, Element>> |
| constexpr | span (array< Element, N > &elements) |
| | Makes a span of an array.
|
| template<typename Element, size_t N, typename = internal::IfPointerConverts<T, Element const>> |
| constexpr | span (array< Element, N > const &elements) |
| | Makes a span of an array.
|
| template<typename Element, typename = internal::IfPointerConverts<T, Element>> |
| constexpr | span (span< Element > const &other) |
| | Makes a span of what other views, as one of uint8_t into one of uint8_t const.
|
|
MAXMATRIX_NODISCARD constexpr T * | data () const |
| | Returns the address of the first element.
|
|
MAXMATRIX_NODISCARD constexpr size_type | size () const |
| | Returns the number of elements.
|
| constexpr T & | operator[] (size_type index) const |
| | Returns the element at index, unchecked.
|
| MAXMATRIX_NODISCARD constexpr span | first (size_type count) const |
| | Returns a span of the first count elements.
|
| MAXMATRIX_NODISCARD constexpr span | subspan (size_type offset) const |
| | Returns a span of the elements from offset on.
|
template<typename T>
class max_matrix::span< T >
A view of size() elements that another owns: a font, a bitmap, a text or a buffer.
It is made of an array, which gives its size, so that a function that takes one cannot read past the end:
It owns nothing; what it views has to live as long as it is used.
- Template Parameters
-
| T | The type of the elements, const for a view that cannot write. |
- Differs from the standard:
- Only a size known at run time, and only data(), size(), the index operator, first() and subspan(): nothing in the library needs more yet.