Template Class spanrsl

Inheritance Relationships

Base Type

Class Documentation

template<class T, class I = C4_SIZE_TYPE>
class spanrsl : public c4::span_crtp<T, C4_SIZE_TYPE, spanrsl<T, C4_SIZE_TYPE>>

A non-owning span which always retains the capacity of the original range it was taken from (though it may loose its original size). The resizing methods resize(), ltrim(), rtrim() as well as the subselection methods subspan(), range(), first() and last() can be used at will without loosing the original capacity; the full capacity span can always be recovered by calling original().

Public Types

using NCT = typename std::remove_const<T>::type

NCT=non const type.

using CT = typename std::add_const<T>::type

CT=const type.

using const_type = spanrsl<CT, I>

Public Functions

_c4_DEFINE_ARRAY_TYPES(T, I)
inline C4_ALWAYS_INLINE operator span<T, I>() const noexcept
inline C4_ALWAYS_INLINE operator spanrs<T, I>() const noexcept
inline C4_ALWAYS_INLINE operator spanrsl<CT, I>() const noexcept
inline C4_ALWAYS_INLINE spanrsl() noexcept
spanrsl(spanrsl const&) = default
spanrsl(spanrsl&&) = default
spanrsl &operator=(spanrsl const&) = default
spanrsl &operator=(spanrsl&&) = default
inline C4_ALWAYS_INLINE spanrsl(T *p, I sz) noexcept
inline C4_ALWAYS_INLINE void assign (T *p, I sz) noexcept
inline C4_ALWAYS_INLINE spanrsl(T *p, I sz, I cap) noexcept
inline C4_ALWAYS_INLINE void assign (T *p, I sz, I cap) noexcept
inline C4_ALWAYS_INLINE spanrsl(T *p, I sz, I cap, I offs) noexcept
inline C4_ALWAYS_INLINE void assign (T *p, I sz, I cap, I offs) noexcept
template<size_t N>
inline C4_ALWAYS_INLINE spanrsl(T (&arr)[N]) noexcept
template<size_t N> inline C4_ALWAYS_INLINE void assign (T(&arr)[N]) noexcept
inline C4_ALWAYS_INLINE spanrsl(c4::aggregate_t, std::initializer_list<T> il) noexcept
inline C4_ALWAYS_INLINE void assign (c4::aggregate_t, std::initializer_list< T > il) noexcept
inline C4_ALWAYS_INLINE I offset () const noexcept
inline C4_ALWAYS_INLINE I capacity () const noexcept
inline C4_ALWAYS_INLINE void resize (I sz) C4_NOEXCEPT_A
inline C4_ALWAYS_INLINE void rtrim (I n) C4_NOEXCEPT_A
inline C4_ALWAYS_INLINE void ltrim (I n) C4_NOEXCEPT_A
inline C4_ALWAYS_INLINE spanrsl original () const

recover the original span as an spanrsl

template<template< class, class > class OtherSpanType> inline C4_ALWAYS_INLINE OtherSpanType< T, I > original ()

recover the original span as a different span type. Example: spanrs<…> orig = s.original<spanrs>();