Rudimentary functionality similar to std::span for holding memory view. More...
Public Types | |
using | element_type = Type |
using | value_type = std::remove_cv< Type > |
using | size_type = std::size_t |
using | pointer = Type * |
using | const_pointer = const Type * |
using | reference = Type & |
using | const_reference = const Type & |
using | difference_type = std::ptrdiff_t |
using | iterator = Type * |
Public Member Functions | |
span (const span &other) noexcept=default | |
Copy construct. More... | |
span & | operator= (const span &other) noexcept=default |
Copy assignment. More... | |
constexpr | span () noexcept |
Default construct. More... | |
constexpr | span (pointer ptr, size_type count) noexcept |
Construct from pointer and size. More... | |
constexpr | span (pointer first, pointer last) noexcept |
Construct from begin/end pointers. More... | |
~span () noexcept=default | |
Destructor. More... | |
constexpr iterator | begin () const noexcept |
Iterator to begin of span. More... | |
constexpr iterator | end () const noexcept |
Iterator to one-past end of span. More... | |
constexpr reference | front () const |
Access the first element. Undefined if span is empty. More... | |
constexpr reference | back () const |
Access the last element. Undefined if span is empty. More... | |
constexpr reference | operator[] (size_type idx) const |
Access an element of the sequence. More... | |
constexpr pointer | data () const noexcept |
Return a pointer to the beginning of the sequence. More... | |
constexpr size_type | size () const noexcept |
Number of elements in the sequence. More... | |
constexpr size_type | size_bytes () const noexcept |
The size of the sequence in bytes. More... | |
constexpr bool | empty () const noexcept |
True if the sequence is empty. More... | |
span< Type > | first (size_type count) const noexcept |
Obtains a span of the first count elements. More... | |
span< Type > | last (size_type count) const noexcept |
Obtains a span of the last count elements. More... | |
span< Type > | subspan (size_type pos) const noexcept |
Obtains a sub-span starting at pos until end of the sequence. More... | |
span< Type > | subspan (size_type pos, size_type len) const noexcept |
Obtains a sub-span of length len starting at pos. More... | |
constexpr const char * | cdata_bytes () const noexcept |
A readonly view as byte content. More... | |
template<class TypeT = Type> | |
std::enable_if<!std::is_const< TypeT >::value, char * >::type | data_bytes () const noexcept |
A writable view as byte content (if the pointer type is non-const). Like data(), the const access itself is const. More... | |
Rudimentary functionality similar to std::span for holding memory view.
using element_type = Type |
using value_type = std::remove_cv<Type> |
using const_pointer = const Type* |
using const_reference = const Type& |
using difference_type = std::ptrdiff_t |
|
defaultnoexcept |
Destructor.
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Obtains a span of the first count elements.
Definition at line 646 of file stdFoam.H.
References Foam::BitOps::count().
Obtains a span of the last count elements.
Definition at line 654 of file stdFoam.H.
References Foam::BitOps::count().
Obtains a sub-span starting at pos until end of the sequence.
Definition at line 662 of file stdFoam.H.
References Foam::pos().
Obtains a sub-span of length len starting at pos.
Graciously handles excess lengths.
Definition at line 672 of file stdFoam.H.
References stdFoam::min(), and Foam::pos().
|
inlinenoexcept |
|
inlinenoexcept |