|
tdslite latest
C++ API reference
|
Span of T. More...
#include <tdslite/util/tdsl_span.hpp>
Public Types | |
| using | element_type = T |
| using | value_type = typename traits::remove_cv< T >::type |
| using | size_type = tdsl::size_t |
| using | ssize_type = tdsl::ssize_t |
| using | pointer = T * |
| using | const_pointer = const T * |
| using | reference = T & |
| using | const_reference = const T & |
| using | iterator = pointer |
| using | const_iterator = const_pointer |
| using | self_type = span< element_type > |
Public Member Functions | |
| constexpr | span () noexcept=default |
| Default c-tor. | |
| constexpr | span (const self_type &other) noexcept |
| Copy c-tor. | |
| constexpr | span (self_type &&other) noexcept |
| Move c-tor. | |
| constexpr | span (element_type *elem, size_type elem_count) noexcept |
| Construct a new span object. | |
| constexpr | span (element_type *begin, element_type *end) noexcept |
| Construct a new span object from explicit begin and end parameters. | |
| template<size_type N> | |
| constexpr | span (element_type(&buffer)[N]) noexcept |
| Construct a new span object from a fixed-size array. | |
| span & | operator= (const self_type &other) noexcept |
| Copy assignment. | |
| span & | operator= (self_type &&other) noexcept |
| Move assignment. | |
| constexpr bool | operator== (const self_type &other) const noexcept |
| Equality comparison operator. | |
| constexpr auto | size_bytes () const noexcept -> size_type |
| Get the amount of the bytes in the span. | |
| constexpr auto | size () const noexcept -> size_type |
| Get the amount of the elements in the span. | |
| constexpr auto | ssize () const noexcept -> ssize_type |
| Get the amount of the elements in the span. | |
| constexpr auto | data () const noexcept -> pointer |
| Data pointer. | |
| constexpr auto | begin () const noexcept -> iterator |
| Iterator interface begin() function. | |
| constexpr auto | end () const noexcept -> iterator |
| Iterator interface end() function. | |
| constexpr auto | cbegin () const noexcept -> const_iterator |
| Iterator interface begin() function. | |
| constexpr auto | cend () const noexcept -> const_iterator |
| Iterator interface end() function. | |
| auto | operator[] (size_type index) const noexcept -> reference |
| Subscript operator. | |
| operator bool () const noexcept | |
| Make span boolable, so it can be used expressions like: span<int> span_v; ... if(span_v){ ..do stuff. | |
| template<typename Q , traits::enable_when::integral< Q > = true> | |
| constexpr auto | rebind_cast () const noexcept -> span< const Q > |
| Cast span to another span with new element type. | |
Protected Attributes | |
| size_type | element_count {0} |
| Size of the span (in element count) | |
Span of T.
| using tdsl::span< T >::element_type = T |
| using tdsl::span< T >::value_type = typename traits::remove_cv<T>::type |
| using tdsl::span< T >::size_type = tdsl::size_t |
| using tdsl::span< T >::ssize_type = tdsl::ssize_t |
| using tdsl::span< T >::pointer = T * |
| using tdsl::span< T >::const_pointer = const T * |
| using tdsl::span< T >::reference = T & |
| using tdsl::span< T >::const_reference = const T & |
| using tdsl::span< T >::iterator = pointer |
| using tdsl::span< T >::const_iterator = const_pointer |
| using tdsl::span< T >::self_type = span<element_type> |
|
inlineconstexprdefaultnoexcept |
Default c-tor.
|
inlineconstexprnoexcept |
Copy c-tor.
|
inlineconstexprnoexcept |
Move c-tor.
|
inlineexplicitconstexprnoexcept |
Construct a new span object.
| [in] | elem | Pointer to the starting element |
| [in] | elem_count | Element count |
|
inlineexplicitconstexprnoexcept |
Construct a new span object from explicit begin and end parameters.
| [in] | begin | Start of the span. |
| [in] | end | End of the span. Must be greater than begin |
end must point to one past last element start must be always lesser than end end must be always greater than start
|
inlineconstexprnoexcept |
Construct a new span object from a fixed-size array.
| N | Auto-deduced length of the array |
| [in] | buffer | Fixed-size buffer |
|
inlinenoexcept |
Copy assignment.
|
inlinenoexcept |
Move assignment.
|
inlineconstexprnoexcept |
Equality comparison operator.
Two spans are considered equal if they point to same memory
| [in] | other | Span to compare against |
|
inlineconstexprnoexcept |
Get the amount of the bytes in the span.
|
inlineconstexprnoexcept |
Get the amount of the elements in the span.
|
inlineconstexprnoexcept |
Get the amount of the elements in the span.
|
inlineconstexprnoexcept |
Data pointer.
|
inlineconstexprnoexcept |
Iterator interface begin() function.
|
inlineconstexprnoexcept |
Iterator interface end() function.
|
inlineconstexprnoexcept |
Iterator interface begin() function.
|
inlineconstexprnoexcept |
Iterator interface end() function.
|
inlinenoexcept |
Subscript operator.
| [in] | index | Element to access |
|
inlinenoexcept |
Make span boolable, so it can be used expressions like: span<int> span_v; ... if(span_v){ ..do stuff.
}
|
inlineconstexprnoexcept |
Cast span to another span with new element type.
| Q | New element type |
|
protected |
Size of the span (in element count)