|
|
constexpr | span () noexcept |
| | Construct a span of no elements.
|
| constexpr | span (pointer data, size_type size) noexcept |
| | Construct a span from its first element and its size.
|
| template<typename U, typename = typename std::enable_if< std::is_convertible<U (*)[], T (*)[]>::value >::type> |
| constexpr | span (const span< U > &other) noexcept |
| | Construct a span from one of a less qualified element type.
|
|
| span (const span &other)=default |
|
span & | operator= (const span &other)=default |
| constexpr pointer | data () const noexcept |
| | Get the first element.
|
| constexpr size_type | size () const noexcept |
| | Get the number of elements.
|
| constexpr bool | empty () const noexcept |
| | Check whether the span has no elements.
|
| constexpr reference | operator[] (size_type index) const noexcept |
| | Get one element.
|
| constexpr reference | front () const noexcept |
| | Get the first element.
|
| constexpr reference | back () const noexcept |
| | Get the last element.
|
| constexpr iterator | begin () const noexcept |
| | Get an iterator to the first element.
|
| constexpr iterator | end () const noexcept |
| | Get an iterator past the last element.
|
template<typename T>
class vitrio::span< T >
A view of a contiguous sequence of elements.
A span refers to elements it does not own, through a pointer to the first one and a count. Copying a span copies the reference and not the elements. The elements must outlive every span that refers to them.
A span of a const type gives read-only access to its elements. A span of a non-const type converts to it.
- Template Parameters
-
| T | Type of the elements. It may be const. |