Template Class span

Inheritance Relationships

Base Type

Class Documentation

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

A non-owning span of elements contiguously stored in memory.

Construction and assignment from same type

template<size_t N> inline C4_ALWAYS_INLINE C4_CONSTEXPR14 span (T(&arr)[N]) noexcept
template<size_t N> inline C4_ALWAYS_INLINE C4_CONSTEXPR14 void assign (T(&arr)[N]) noexcept
inline C4_ALWAYS_INLINE C4_CONSTEXPR14 span (T *p, I sz) noexcept
inline C4_ALWAYS_INLINE C4_CONSTEXPR14 void assign (T *p, I sz) noexcept
inline C4_ALWAYS_INLINE C4_CONSTEXPR14 span (c4::aggregate_t, std::initializer_list< T > il) noexcept
inline C4_ALWAYS_INLINE C4_CONSTEXPR14 void assign (c4::aggregate_t, std::initializer_list< T > il) noexcept

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 = span<CT, I>

Public Functions

_c4_DEFINE_ARRAY_TYPES(T, I)
inline operator span<CT, I>() const

convert automatically to span of const T

inline C4_ALWAYS_INLINE C4_CONSTEXPR14 span () noexcept
span(span const&) = default
span(span&&) = default
span &operator=(span const&) = default
span &operator=(span&&) = default
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