Range-v3
Range algorithms, views, and actions for the Standard Library
ranges::span< T, N > Struct Template Reference
+ Inheritance diagram for ranges::span< T, N >:

Public Types

using difference_type = index_type
 
using element_type = T
 
using index_type = detail::span_index_t
 
using iterator = T *
 
using pointer = T *
 
using reference = T &
 
using reverse_iterator = ranges::reverse_iterator< iterator >
 
using value_type = meta::_t< std::remove_cv< T > >
 

Public Member Functions

constexpr iterator begin () const noexcept
 
constexpr pointer data () const noexcept
 
constexpr bool empty () const noexcept
 
constexpr iterator end () const noexcept
 
template<index_type Count>
constexpr span< T, Count > first () const noexcept
 
constexpr span< T > first (index_type cnt) const noexcept
 
template<index_type Count>
constexpr span< T, Count > last () const noexcept
 
constexpr span< T > last (index_type cnt) const noexcept
 
template<typename U , index_type M>
requires equality_comparable_with<T, U>
bool operator!= (span< U, M > const &that) const
 
template<typename U , index_type M>
requires totally_ordered_with<T, U>
bool operator< (span< U, M > const &that) const
 
template<typename U , index_type M>
requires totally_ordered_with<T, U>
bool operator<= (span< U, M > const &that) const
 
template<typename U , index_type M>
requires equality_comparable_with<T, U>
bool operator== (span< U, M > const &that) const
 
template<typename U , index_type M>
requires totally_ordered_with<T, U>
bool operator> (span< U, M > const &that) const
 
template<typename U , index_type M>
requires totally_ordered_with<T, U>
bool operator>= (span< U, M > const &that) const
 
constexpr reference operator[] (index_type idx) const noexcept
 
constexpr reverse_iterator rbegin () const noexcept
 
constexpr reverse_iterator rend () const noexcept
 
constexpr index_type size_bytes () const noexcept
 
template<typename = void>
constexpr span (pointer first, pointer last) noexcept
 
constexpr span (pointer ptr, index_type cnt) noexcept
 
template<typename Rng >
requires (!same_as<span, uncvref_t<Rng>>) && span_compatible_range<Rng, T> && span_static_conversion<Rng, N>
constexpr span (Rng &&rng) noexcept(noexcept(ranges::data(rng)))
 
template<typename Rng >
requires (!same_as<span, uncvref_t<Rng>>) && span_compatible_range<Rng, T> && span_dynamic_conversion<Rng, N>
constexpr span (Rng &&rng) noexcept(noexcept(ranges::data(rng), ranges::size(rng)))
 
template<index_type Offset, index_type Count>
constexpr span< T, detail::subspan_extent(N, Offset, Count)> subspan () const noexcept
 
template<index_type Offset>
constexpr span< T,(N >=Offset ? N - Offset :dynamic_extent)> subspan () const noexcept
 
constexpr span< T, dynamic_extent > subspan (index_type offset) const noexcept
 
constexpr span< T, dynamic_extent > subspan (index_type offset, index_type cnt) const noexcept
 
- Public Member Functions inherited from ranges::view_interface< span< T, dynamic_extent >,(dynamic_extent==dynamic_extent ? finite :static_cast< cardinality >(dynamic_extent))>
constexpr auto empty () const noexcept -> bool
 Test whether a range can be empty:
 
&&!detail ::has_fixed_size_< Cardinality > &&forward_range< D< True > const > constexpr bool empty () const noexcept(noexcept(bool(ranges::begin(std::declval< D< True > const & >())==ranges::end(std::declval< D< True > const & >()))))
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
&&Cardinality< 0) &&(Cardinality !=infinite) &&(!forward_range< D< True > >) &&sized_range< D< True > > constexpr bool empty() noexcept(noexcept(bool(ranges::size(std::declval< D< True > & >())==0))) { return ranges::size(derived())==0;} template< bool True=true > &&Cardinality< 0) &&(Cardinality !=infinite) &&(!forward_range< D< True > const >) &&sized_range< D< True > const > constexpr bool empty() const noexcept(noexcept(bool(ranges::size(std::declval< D< True > const & >())==0))) { return ranges::size(derived())==0;} template< bool True=true > &&!detail ::has_fixed_size_< Cardinality > &&forward_range< D< True > > constexpr bool empty () noexcept(noexcept(bool(ranges::begin(std::declval< D< True > & >())==ranges::end(std::declval< D< True > & >()))))
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
&&detail::can_empty_< D< True > const > constexpr operator bool () const noexcept(noexcept(ranges::empty(std::declval< D< True > const & >())))
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
&&detail::can_empty_< D< True > > constexpr operator bool () noexcept(noexcept(ranges::empty(std::declval< D< True > & >())))
 
view_interfaceoperator= (view_interface &&)=default
 
view_interfaceoperator= (view_interface const &)=default
 
 view_interface (view_interface &&)=default
 
 view_interface (view_interface const &)=default
 

Static Public Attributes

static constexpr index_type extent = N
 

Additional Inherited Members

- Protected Types inherited from ranges::view_interface< span< T, dynamic_extent >,(dynamic_extent==dynamic_extent ? finite :static_cast< cardinality >(dynamic_extent))>
using D = meta::invoke< detail::dependent_< B >, span< T, dynamic_extent > >
 
- Protected Member Functions inherited from ranges::view_interface< span< T, dynamic_extent >,(dynamic_extent==dynamic_extent ? finite :static_cast< cardinality >(dynamic_extent))>
constexpr span< T, dynamic_extent > const & derived () const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
constexpr span< T, dynamic_extent > & derived () noexcept