|
| | Span () noexcept=default |
| | ~Span () noexcept=default |
| template<typename U, std::enable_if_t< std::is_convertible_v< U *, T * >, int > = 0> |
| constexpr | Span (const Span< U > &other) noexcept |
| | Copy from a compatible Span.
|
| constexpr | Span (pointer ptr, index_type count) noexcept |
| | Builds a Span out of a pointer and an element count.
|
| template<std::size_t n> |
| constexpr | Span (std::array< value_type, n > &array) noexcept |
| | Builds a Span out of an array.
|
| template<std::size_t n> |
| constexpr | Span (const std::array< value_type, n > &array) noexcept |
| | Builds a Span out of an array.
|
| template<typename U, std::size_t n, std::enable_if_t< std::is_convertible_v< U *, T * >, int > = 0> |
| constexpr | Span (std::array< U, n > &array) noexcept |
| | Builds a Span out of an array.
|
| template<typename U, std::size_t n, std::enable_if_t< std::is_convertible_v< U *, T * >, int > = 0> |
| constexpr | Span (const std::array< U, n > &array) noexcept |
| | Builds a Span out of a const array.
|
| constexpr | Span (std::vector< value_type > &vector) noexcept |
| | Builds a Span out of a vector. NOLINTNEXTLINE(hicpp-explicit-conversions).
|
| constexpr | Span (const std::vector< value_type > &vector) noexcept |
| | Builds a Span out of a vector. NOLINTNEXTLINE(hicpp-explicit-conversions).
|
| template<typename U, std::enable_if_t< std::is_convertible_v< U *, T * >, int > = 0> |
| constexpr | Span (std::vector< U > &vector) noexcept |
| | Builds a Span out of a compatible vector.
|
| template<typename U, std::enable_if_t< std::is_convertible_v< U *, T * >, int > = 0> |
| constexpr | Span (const std::vector< U > &vector) noexcept |
| | Builds a Span out of a const compatible vector.
|
| Span | first (index_type count) const noexcept |
| | Returns a new span over the first count elements of *this.
|
| Span | last (index_type count) const noexcept |
| | Returns a new Span over the last count elements of *this.
|
| Span | subspan (index_type offset=0) const noexcept |
| | Returns a new Span over the elements of *this beginning at offset and extending for size() - offset elements.
|
| Span | subspan (index_type offset, index_type count) const noexcept |
| | Returns a new Span over the elements of *this beginning at offset and extending for count elements.
|
| constexpr std::size_t | size () const noexcept |
| | Number of elements covered by the Span.
|
| constexpr bool | empty () const noexcept |
| reference | operator[] (index_type i) const noexcept |
| | Gets the element at index i. Complexity: constant.
|
| constexpr pointer | data () const noexcept |
| | Direct access to the underlying storage. Complexity: constant.
|
| constexpr iterator | begin () const noexcept |
| | Returns an iterator to the first element of the Span. If the vector is empty, the returned iterator will be equal to end(). Complexity: constant.
|
| constexpr iterator | end () const noexcept |
| | Iterator to the element following the last element. Complexity: constant. NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic).
|
| constexpr const_iterator | cbegin () const noexcept |
| | Returns a const iterator to the first element of the vector. If the Span is empty, the returned iterator will be equal to cend(). Complexity: constant.
|
| constexpr const_iterator | cend () const noexcept |
| | Constant iterator to the element following the last element. Complexity: constant. NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic).
|
template<class T>
class sen::Span< T >
Contiguous view of elements of type T. Inspired by http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0122r7.pdf.
- Warning
- this class does not perform range checks.
- Template Parameters
-