|
|
using | element_kind = T |
| | Element type, including const qualification.
|
| |
|
using | value_type = typename std::remove_cv< T >::type |
| | Element type without const qualification.
|
| |
|
using | size_type = span_size_type |
| | Type used for element counts.
|
| |
|
using | difference_type = span_diff_type |
| | Type used for iterator differences.
|
| |
|
using | pointer = element_kind * |
| | Pointer to an element.
|
| |
|
using | const_pointer = const element_kind * |
| | Pointer to a const element.
|
| |
|
using | reference = element_kind & |
| | Reference to an element.
|
| |
|
using | const_reference = const element_kind & |
| | Reference to a const element.
|
| |
|
using | iterator = pointer |
| | Mutable iterator type.
|
| |
|
using | const_iterator = const_pointer |
| | Const iterator type.
|
| |
|
using | iterator_type = core::random_access_iterator_tag |
| | Gaia-ECS iterator category exposed by span iterators.
|
| |
| template<span_size_type Offset, span_size_type Count = DynamicSpanExtent> |
| using | subspan_return_t = span< T, Count !=DynamicSpanExtent ? Count :(Extent !=DynamicSpanExtent ? Extent - Offset :DynamicSpanExtent)> |
| | Result type for a compile-time subspan selection.
|
| |
|
| template<span_size_type E = Extent, typename std::enable_if<(E==DynamicSpanExtent||E<=0), int >::type = 0> |
| constexpr | span () noexcept |
| | Constructs an empty span when its extent permits an empty view.
|
| |
| constexpr | span (pointer ptr, size_type count) |
| | Constructs a view over count elements starting at ptr.
|
| |
| constexpr | span (pointer begin, pointer end) |
| | Constructs a view over the half-open range [begin, end).
|
| |
| template<span_size_type N, span_size_type E = Extent, typename std::enable_if<(E==DynamicSpanExtent||N==E) &&detail::is_container_element_kind_compatible< element_kind(&)[N], T >::value, int >::type = 0> |
| constexpr | span (element_kind(&arr)[N]) noexcept |
| | Constructs a view over a compatible built-in array.
|
| |
| template<typename Container , span_size_type E = Extent, typename std::enable_if< E==DynamicSpanExtent &&detail::is_container< Container >::value &&detail::is_container_element_kind_compatible< Container &, T >::value, int >::type = 0> |
| constexpr | span (Container &cont) |
| | Constructs a dynamic-extent view over a compatible mutable container.
|
| |
| template<typename Container , span_size_type E = Extent, typename std::enable_if< E==DynamicSpanExtent &&detail::is_container< Container >::value &&detail::is_container_element_kind_compatible< const Container &, T >::value, int >::type = 0> |
| constexpr | span (const Container &cont) |
| | Constructs a dynamic-extent view over a compatible const container.
|
| |
|
constexpr | span (const span &) noexcept=default |
| |
|
constexpr span & | operator= (const span &) noexcept=default |
| |
| template<typename T2 , span_size_type Extent2, typename std::enable_if<(Extent==DynamicSpanExtent||Extent2==DynamicSpanExtent||Extent==Extent2) &&std::is_convertible< T2(*)[], T(*)[]>::value, int >::type = 0> |
| constexpr | span (const span< T2, Extent2 > &other) noexcept |
| | Constructs a compatible span from another element type or extent.
|
| |
| GAIA_NODISCARD constexpr pointer | data () const noexcept |
| | Returns a pointer to the first element.
|
| |
| GAIA_NODISCARD constexpr size_type | size () const noexcept |
| | Returns the number of elements in the view.
|
| |
| GAIA_NODISCARD constexpr bool | empty () const noexcept |
| | Checks whether the view is empty.
|
| |
| GAIA_NODISCARD constexpr reference | operator[] (size_type index) const |
| | Returns the element at index.
|
| |
| GAIA_NODISCARD constexpr iterator | begin () noexcept |
| | Returns an iterator to the first element.
|
| |
| GAIA_NODISCARD constexpr iterator | begin () const noexcept |
| | Returns an iterator to the first element.
|
| |
| GAIA_NODISCARD constexpr const_iterator | cbegin () const noexcept |
| | Returns a const iterator to the first element.
|
| |
| GAIA_NODISCARD constexpr iterator | end () noexcept |
| | Returns an iterator one past the final element.
|
| |
| GAIA_NODISCARD constexpr const_iterator | end () const noexcept |
| | Returns a const iterator one past the final element.
|
| |
| GAIA_NODISCARD constexpr const_iterator | cend () const noexcept |
| | Returns a const iterator one past the final element.
|
| |
| template<span_size_type Count> |
| GAIA_NODISCARD constexpr span< element_kind, Count > | first () const |
| | Returns the first Count elements with a compile-time extent.
|
| |
| GAIA_NODISCARD constexpr span< element_kind, DynamicSpanExtent > | first (size_type count) const |
| | Returns a dynamic-extent view over the first count elements.
|
| |
| template<span_size_type Count> |
| GAIA_NODISCARD constexpr span< element_kind, Count > | last () const |
| | Returns the last Count elements with a compile-time extent.
|
| |
| GAIA_NODISCARD constexpr span< element_kind, DynamicSpanExtent > | last (size_type count) const |
| | Returns a dynamic-extent view over the last count elements.
|
| |
| GAIA_NODISCARD constexpr reference | front () const |
| | Returns the first element.
|
| |
| GAIA_NODISCARD constexpr reference | back () const |
| | Returns the final element.
|
| |
| template<span_size_type Offset, span_size_type Count = DynamicSpanExtent> |
| GAIA_NODISCARD constexpr subspan_return_t< Offset, Count > | subspan () const |
| | Returns a subspan selected with compile-time offset and count.
|
| |
| GAIA_NODISCARD constexpr span< element_kind, DynamicSpanExtent > | subspan (size_type offset, size_type count=DynamicSpanExtent) const |
| | Returns a dynamic-extent subspan.
|
| |
template<typename T, span_size_type Extent>
class gaia::core::span< T, Extent >
Non-owning view over a contiguous sequence of objects.
- Template Parameters
-
| T | Element type. |
| Extent | Compile-time element count, or DynamicSpanExtent for a runtime count. |