span is a compact view over a contiguous range of data.
More...
#include <span.hpp>
|
constexpr | span ()=default |
| Constructs an empty span of size 0. More...
|
|
constexpr | span (pointer p, index_type size) noexcept |
| Constructs a span from a pointer + size pair. More...
|
|
constexpr | span (pointer first, pointer last) noexcept |
| Constructs a span from two pointer s. More...
|
|
template<std::size_t M> |
constexpr | span (element_type(&arr)[M]) noexcept |
| Implicit conversion from a built-in C-style array. More...
|
|
template<typename Container , typename = std::enable_if_t<!std::is_array<Container>::value>, typename = std::enable_if_t<!is_span<std::remove_const_t<Container>>::value>, typename = std::enable_if_t< std::is_convertible<detected_t<detail::array_type_t, Container&>, element_type (*)[]>::value>> |
constexpr | span (Container &container) noexcept |
| Implicit conversion from mutable Container-like types. More...
|
|
template<typename S , index_type OtherExtents, typename = std::enable_if_t<std::is_convertible<S (*)[], T (*)[]>::value>> |
constexpr | span (const span< S, OtherExtents > &s) noexcept |
| Implicit conversion from other span types. More...
|
|
constexpr | span (const span &s) noexcept=default |
|
template<typename T>
class fub::span< T, dynamic_extent >
span is a compact view over a contiguous range of data.
This class models something like
T * pointer
Definition: span.hpp:708
constexpr span()=default
Constructs an empty span of size 0.
Where the length
can be omitted for statically sized views.
◆ const_iterator
◆ const_reverse_iterator
◆ difference_type
◆ element_type
◆ index_type
◆ iterator
◆ pointer
◆ reference
◆ reverse_iterator
◆ value_type
◆ span() [1/7]
Constructs an empty span of size 0.
This initializes the underlying pointer to nullptr and the size to 0.
- Exceptions
-
- Postcondition
- data() == nullptr
-
size() == 0
◆ span() [2/7]
Constructs a span from a pointer
+ size
pair.
This performs an assertion check in debug builds which will terminate the application if the specified size does not match the extent.
- Exceptions
-
- Postcondition
- data() == p
-
size() == size
◆ span() [3/7]
Constructs a span from two pointer
s.
This performs an assertion check in debug builds which will terminate the application if the specified size does not match the extent.
- Exceptions
-
- Postcondition
- data() == first
-
size() == last - first
◆ span() [4/7]
template<typename T >
template<std::size_t M>
Implicit conversion from a built-in C-style array.
- Exceptions
-
- Postcondition
- data() = pointer(&arr[0])
-
size() == M
◆ span() [5/7]
template<typename T >
template<typename Container , typename = std::enable_if_t<!std::is_array<Container>::value>, typename = std::enable_if_t<!is_span<std::remove_const_t<Container>>::value>, typename = std::enable_if_t< std::is_convertible<detected_t<detail::array_type_t, Container&>, element_type (*)[]>::value>>
Implicit conversion from mutable Container-like types.
- Precondition
- S(*)[] is convertible to element_type(*)[]
- Exceptions
-
- Postcondition
- data() = container.data()
-
size() = container.size()
◆ span() [6/7]
template<typename T >
template<typename S , index_type OtherExtents, typename = std::enable_if_t<std::is_convertible<S (*)[], T (*)[]>::value>>
Implicit conversion from other span types.
- Precondition
- size() <= M
-
std::is_convertible<S(*)[], T(*)[]>::value
- Postcondition
- data() == s.data()
◆ span() [7/7]
◆ extent
The documentation for this class was generated from the following file: