|
template<size_type ext = Extent, typename std::enable_if<(ext==0||ext==dynamic_extent), int >::type = 0> |
constexpr | Span () noexcept |
|
constexpr | Span (pointer first_, size_type count) |
|
constexpr | Span (pointer first_, pointer last_) |
|
template<size_type N, size_type ext = Extent, typename std::enable_if<(ext==dynamic_extent||ext==N), int >::type = 0> |
constexpr | Span (element_type(&arr)[N]) noexcept |
|
template<typename U , size_type N, size_type ext = Extent, typename std::enable_if<(ext==dynamic_extent||ext==N) &&std::is_convertible< U(*)[], T(*)[]>::value, int >::type = 0> |
constexpr | Span (std::array< U, N > &arr) noexcept |
|
template<typename U , size_type N, size_type ext = Extent, typename std::enable_if<(ext==dynamic_extent||ext==N) &&std::is_convertible< const U(*)[], T(*)[]>::value, int >::type = 0> |
constexpr | Span (const std::array< U, N > &arr) noexcept |
|
template<typename U , typename ALLOC , size_type ext = Extent, typename std::enable_if<(ext==dynamic_extent) &&std::is_convertible< U(*)[], T(*)[]>::value, int >::type = 0> |
constexpr | Span (std::vector< U, ALLOC > &vec) |
|
template<typename U , typename ALLOC , size_type ext = Extent, typename std::enable_if<(ext==dynamic_extent) &&std::is_convertible< const U(*)[], T(*)[]>::value, int >::type = 0> |
constexpr | Span (const std::vector< U, ALLOC > &vec) |
|
template<typename U , size_type N, typename std::enable_if<(Extent==N||Extent==dynamic_extent) &&std::is_convertible< U(*)[], T(*)[]>::value, int >::type = 0> |
constexpr | Span (const Span< U, N > &span) noexcept |
|
constexpr iterator | begin () const noexcept |
|
constexpr iterator | end () const noexcept |
|
constexpr reverse_iterator | rbegin () const noexcept |
|
constexpr reverse_iterator | rend () const noexcept |
|
constexpr reference | front () const |
|
constexpr reference | back () const |
|
constexpr reference | operator[] (size_type idx) const |
|
constexpr pointer | data () const noexcept |
|
constexpr size_type | size () const noexcept |
|
constexpr size_type | size_bytes () const noexcept |
|
constexpr bool | empty () const noexcept |
|
template<size_type Count> |
constexpr Span< element_type, Count > | first () const |
|
constexpr Span< element_type, dynamic_extent > | first (size_type Count) const |
|
template<size_type Count> |
constexpr Span< element_type, Count > | last () const |
|
constexpr Span< element_type, dynamic_extent > | last (size_type Count) const |
|
constexpr Span< element_type, dynamic_extent > | subspan (size_type Offset, size_type Count=dynamic_extent) const |
|
|
| ~Span ()=default |
|
| Span (const Span &other) noexcept=default |
|
Span & | operator= (const Span &other) noexcept=default |
|
| Span (Span &&other) noexcept=default |
|
Span & | operator= (Span &&other) noexcept=default |
|
|
template<size_type Offset, size_type Count = dynamic_extent, typename std::enable_if< Count==dynamic_extent, int >::type = 0> |
constexpr SubspanReturnType< Offset, Count > | subspan () const |
|
template<size_type Offset, size_type Count, typename std::enable_if< Count !=dynamic_extent, int >::type = 0> |
constexpr SubspanReturnType< Offset, Count > | subspan () const |
|
template<typename T, std::size_t Extent = dynamic_extent>
class zserio::Span< T, Extent >
Class that holds non-owning reference (aka. "view") to continuous sequence of objects. The user of this class is responsible of making sure, that the referenced sequence is valid as long as the instance of the Span is alive. Inspired by C++20 std::span.
Definition at line 58 of file Span.h.
template<typename T , std::size_t Extent = dynamic_extent>
template<typename U , size_type N, size_type ext = Extent, typename std::enable_if<(ext==dynamic_extent||ext==N) &&std::is_convertible< U(*)[], T(*)[]>::value, int >::type = 0>
Constructor. Initializes Span holding a reference to std::array.
- Parameters
-
arr | std::array to which the Span will hold a reference. |
Definition at line 125 of file Span.h.
template<typename T , std::size_t Extent = dynamic_extent>
template<typename U , size_type N, size_type ext = Extent, typename std::enable_if<(ext==dynamic_extent||ext==N) &&std::is_convertible< const U(*)[], T(*)[]>::value, int >::type = 0>
Constructor. Initializes Span holding a reference to std::array.
- Parameters
-
arr | std::array to which the Span will hold a reference. |
Definition at line 138 of file Span.h.
template<typename T , std::size_t Extent = dynamic_extent>
template<typename U , typename ALLOC , size_type ext = Extent, typename std::enable_if<(ext==dynamic_extent) &&std::is_convertible< U(*)[], T(*)[]>::value, int >::type = 0>
Constructor. Initializes Span holding a reference to std::vector.
- Parameters
-
vec | std::vector to which the Span will hold a reference. |
Definition at line 150 of file Span.h.
template<typename T , std::size_t Extent = dynamic_extent>
template<typename U , typename ALLOC , size_type ext = Extent, typename std::enable_if<(ext==dynamic_extent) &&std::is_convertible< const U(*)[], T(*)[]>::value, int >::type = 0>
constexpr zserio::Span< T, Extent >::Span |
( |
const std::vector< U, ALLOC > & |
vec | ) |
|
|
inlineconstexpr |
Constructor. Initializes Span holding a reference to std::vector.
- Parameters
-
vec | std::vector to which the Span will hold a reference. |
Definition at line 163 of file Span.h.
template<typename T , std::size_t Extent = dynamic_extent>
template<typename U , size_type N, typename std::enable_if<(Extent==N||Extent==dynamic_extent) &&std::is_convertible< U(*)[], T(*)[]>::value, int >::type = 0>
Constructor. Convert between spans of different types.
- Parameters
-
Definition at line 176 of file Span.h.