|
| constexpr | span () noexcept |
| |
| constexpr | span (std::nullptr_t) noexcept |
| |
| template<typename U , typename = typename std::enable_if<safe_conversion<U>()>::type> |
| constexpr | span (U *const src_ptr, const std::size_t count) noexcept |
| | Prevent derived-to-base conversions; invalid in this context. More...
|
| |
| template<std::size_t N> |
| constexpr | span (T(&src)[N]) noexcept |
| | Conversion from C-array. Prevents common bugs with sizeof + arrays. More...
|
| |
| constexpr | span (const span &) noexcept=default |
| |
| span & | operator= (const span &) noexcept=default |
| |
| std::size_t | remove_prefix (std::size_t amount) noexcept |
| |
| constexpr iterator | begin () const noexcept |
| |
| constexpr const_iterator | cbegin () const noexcept |
| |
| constexpr iterator | end () const noexcept |
| |
| constexpr const_iterator | cend () const noexcept |
| |
| constexpr bool | empty () const noexcept |
| |
| constexpr pointer | data () const noexcept |
| |
| constexpr std::size_t | size () const noexcept |
| |
| constexpr std::size_t | size_bytes () const noexcept |
| |
| const T & | operator[] (size_t idx) const |
| |
template<typename T>
class epee::span< T >
Non-owning sequence of data. Does not deep copy.
Inspired by gsl::span and/or boost::iterator_range. This class is intended to be used as a parameter type for functions that need to take a writable or read-only sequence of data. Most common cases are span<char> and span<std::uint8_t>. Using as a class member is only recommended if clearly documented as not doing a deep-copy. C-arrays are easily convertible to this type.
- Note
- Conversion from C string literal to
span<const char> will include the NULL-terminator.
-
Never allows derived-to-base pointer conversion; an array of derived types is not an array of base types.
Definition at line 56 of file span.h.