Template Class spanrs
Defined in File rapidyaml-0.5.0.hpp
Inheritance Relationships
Base Type
public c4::span_crtp< T, C4_SIZE_TYPE, spanrs< T, C4_SIZE_TYPE > >
(Template Class span_crtp)
Class Documentation
-
template<class T, class I = C4_SIZE_TYPE>
class spanrs : public c4::span_crtp<T, C4_SIZE_TYPE, spanrs<T, C4_SIZE_TYPE>> A non-owning span resizeable up to a capacity. Subselection or resizing will keep the original provided it starts at begin(). If subselection or resizing change the pointer, then the original capacity information will be lost.
Thus, resizing via resize() and ltrim() and subselecting via first() or any of subspan() or range() when starting from the beginning will keep the original capacity. OTOH, using last(), or any of subspan() or range() with an offset from the start will remove from capacity (shifting the pointer) by the corresponding offset. If this is undesired, then consider using spanrsl.
Construction and assignment from same type
- inline C4_ALWAYS_INLINE void assign (T *p, I sz) noexcept
Warning
will reset the capacity to sz
- inline C4_ALWAYS_INLINE void assign (T *p, I sz, I cap) noexcept
- template<size_t N> inline C4_ALWAYS_INLINE void assign (T(&arr)[N]) noexcept
-
inline C4_ALWAYS_INLINE spanrs(c4::aggregate_t, std::initializer_list<T> il) noexcept
- inline C4_ALWAYS_INLINE void assign (c4::aggregate_t, std::initializer_list< T > il) noexcept
Public Types
Public Functions
-
inline C4_ALWAYS_INLINE operator spanrs<CT, I>() const noexcept
convert automatically to span of const T
convert automatically to spanrs of const T
-
inline C4_ALWAYS_INLINE spanrs() 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