Template Class span

Class Documentation

template<typename ElementType, std::size_t Extent>
class span

Public Types

using element_type = ElementType
using value_type = typename std::remove_cv<ElementType>::type
using size_type = std::size_t
using difference_type = std::ptrdiff_t
using pointer = element_type*
using const_pointer = const element_type*
using reference = element_type&
using const_reference = const element_type&
using iterator = pointer
using reverse_iterator = std::reverse_iterator<iterator>
template<std::size_t Offset, std::size_t Count = dynamic_extent> subspan_return_t = span< ElementType, Count !=dynamic_extent ? Count :(Extent !=dynamic_extent ? Extent - Offset :dynamic_extent)>

Public Functions

template<std::size_t E = Extent, typename std::enable_if<(E == dynamic_extent || E <= 0), int>::type = 0>
inline constexpr span() noexcept
inline TCB_SPAN_CONSTEXPR11 span(pointer ptr, size_type count)
inline TCB_SPAN_CONSTEXPR11 span(pointer first_elem, pointer last_elem)
template<std::size_t N, std::size_t E = Extent, typename std::enable_if<(E == dynamic_extent || N == E) && detail::is_container_element_type_compatible<element_type (&)[N], ElementType>::value, int>::type = 0>
inline constexpr span(element_type (&arr)[N]) noexcept
template<typename T, std::size_t N, std::size_t E = Extent, typename std::enable_if<(E == dynamic_extent || N == E) && detail::is_container_element_type_compatible<std::array<T, N>&, ElementType>::value, int>::type = 0>
inline TCB_SPAN_ARRAY_CONSTEXPR span(std::array<T, N> &arr) noexcept
template<typename T, std::size_t N, std::size_t E = Extent, typename std::enable_if<(E == dynamic_extent || N == E) && detail::is_container_element_type_compatible<const std::array<T, N>&, ElementType>::value, int>::type = 0>
inline TCB_SPAN_ARRAY_CONSTEXPR span(const std::array<T, N> &arr) noexcept
template<typename Container, std::size_t E = Extent, typename std::enable_if<E == dynamic_extent && detail::is_container<Container>::value && detail::is_container_element_type_compatible<Container&, ElementType>::value, int>::type = 0>
inline constexpr span(Container &cont)
template<typename Container, std::size_t E = Extent, typename std::enable_if<E == dynamic_extent && detail::is_container<Container>::value && detail::is_container_element_type_compatible<const Container&, ElementType>::value, int>::type = 0>
inline constexpr span(const Container &cont)
constexpr span(const span &other) noexcept = default
template<typename OtherElementType, std::size_t OtherExtent, typename std::enable_if<(Extent == dynamic_extent || OtherExtent == dynamic_extent || Extent == OtherExtent) && std::is_convertible<OtherElementType (*)[], ElementType (*)[]>::value, int>::type = 0>
inline constexpr span(const span<OtherElementType, OtherExtent> &other) noexcept
~span() noexcept = default
TCB_SPAN_CONSTEXPR_ASSIGN span & operator= (const span &other) noexcept=default
template<std::size_t Count> inline TCB_SPAN_CONSTEXPR11 span< element_type, Count > first () const
template<std::size_t Count> inline TCB_SPAN_CONSTEXPR11 span< element_type, Count > last () const
template<std::size_t Offset, std::size_t Count = dynamic_extent> inline TCB_SPAN_CONSTEXPR11 subspan_return_t< Offset, Count > subspan () const
inline TCB_SPAN_CONSTEXPR11 span< element_type, dynamic_extent > first (size_type count) const
inline TCB_SPAN_CONSTEXPR11 span< element_type, dynamic_extent > last (size_type count) const
inline TCB_SPAN_CONSTEXPR11 span< element_type, dynamic_extent > subspan (size_type offset, size_type count=dynamic_extent) const
inline constexpr size_type size() const noexcept
inline constexpr size_type size_bytes() const noexcept
inline constexpr TCB_SPAN_NODISCARD bool empty () const noexcept
inline TCB_SPAN_CONSTEXPR11 reference operator[] (size_type idx) const
inline TCB_SPAN_CONSTEXPR11 reference front () const
inline TCB_SPAN_CONSTEXPR11 reference back () const
inline constexpr pointer data() const noexcept
inline constexpr iterator begin() const noexcept
inline constexpr iterator end() const noexcept
inline TCB_SPAN_ARRAY_CONSTEXPR reverse_iterator rbegin () const noexcept
inline TCB_SPAN_ARRAY_CONSTEXPR reverse_iterator rend () const noexcept

Public Static Attributes

static constexpr size_type extent = Extent