|
| span () |
|
template<class U , typename = std::enable_if_t<valid_span_type_v<T, U> >> |
| span (U *ptr, size_type sz) |
| Constructor from start and length. More...
|
|
template<class U , typename = std::enable_if_t<valid_span_type_v<T, U> >> |
| span (U *beg, U *end) |
| Constructor from start and end. More...
|
|
| span (const span &)=default |
|
span & | operator= (const span &)=default |
|
template<class U , typename = std::enable_if_t<valid_span_type_v<T, U> >> |
| span (const span< U > &other) |
| Constructor from another span. More...
|
|
constexpr size_type | size () const noexcept |
| Return the size of the span. More...
|
|
constexpr size_type | size_bytes () const noexcept |
| Return the size of contents of the span, in bytes. More...
|
|
constexpr bool | empty () const noexcept |
| Test if the span is empty. More...
|
|
constexpr reference | front () noexcept |
| Return a reference to the first element in the span. More...
|
|
constexpr const_reference | front () const noexcept |
| Return a reference to the first element in the span. More...
|
|
constexpr reference | back () noexcept |
| Return a reference to the last element in the span. More...
|
|
constexpr const_reference | back () const noexcept |
| Return a reference to the last element in the span. More...
|
|
constexpr reference | operator[] (size_type i) noexcept |
| Return a reference to the i-th element in the span. More...
|
|
constexpr const_reference | operator[] (size_type i) const noexcept |
| Return a reference to the i-th element in the span. More...
|
|
constexpr reference | at (size_type i) |
| Return a reference to the i-th element in the span (bounds-checked). More...
|
|
constexpr const_reference | at (size_type i) const |
| Return a reference to the i-th element in the span (bounds-checked). More...
|
|
constexpr pointer | data () noexcept |
| Return a pointer to the start of the span. More...
|
|
constexpr const_pointer | data () const noexcept |
| Return a pointer to the start of the span. More...
|
|
constexpr iterator | begin () noexcept |
| Return a begin iterator. More...
|
|
constexpr const_iterator | begin () const noexcept |
| Return a begin iterator. More...
|
|
constexpr iterator | end () noexcept |
| Return an end iterator. More...
|
|
constexpr const_iterator | end () const noexcept |
| Return an end iterator. More...
|
|
constexpr reverse_iterator | rbegin () noexcept |
| Return a begin reverse iterator. More...
|
|
constexpr const_reverse_iterator | rbegin () const noexcept |
| Return a begin reverse iterator. More...
|
|
constexpr reverse_iterator | rend () noexcept |
| Return an end reverse iterator. More...
|
|
constexpr const_reverse_iterator | rend () const noexcept |
| Return an end reverse iterator. More...
|
|
constexpr span | first (size_type n) noexcept |
| Return a subspan from the start. More...
|
|
constexpr span< const T > | first (size_type n) const noexcept |
| Return a subspan from the start. More...
|
|
constexpr span | last (size_type n) noexcept |
| Return a subspan from the end. More...
|
|
constexpr span< const T > | last (size_type n) const noexcept |
| Return a subspan from the end. More...
|
|
constexpr span | subspan (size_type offs, size_type n=dynamic_extent) noexcept |
| Return a subspan. More...
|
|
constexpr span< const T > | subspan (size_type offs, size_type n=dynamic_extent) const noexcept |
| Return a subspan. More...
|
|
template<class T>
class CxxUtils::span< T >
Simplified version of the C++20 std::span.
This class is meant to be very similar to the C++20 std::span class. There are however a few differences.
- The option for a fixed-length span is not implemented; hence, there is no second template argument.
- Constructors from arrays / std::array are not implemented.
- The external member functions as_bytes / as_writable_bytes and not all deduction guides are implemented.
Contact the core sw group if any of these are a problem.
In addition:
- Accessor methods are split into const / non-const versions. This is required to avoid warnings from the thread-safety checker, but be careful of potential incompatibilies with std::span. Again, contact the core sw group if this is an issue.
Definition at line 63 of file span.h.