scnlib  0.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
scn::span< T > Class Template Reference

A view over a contiguous range. More...

#include <span.h>

Public Types

using element_type = T
 
using value_type = typename std::remove_cv< T >::type
 
using index_type = std::size_t
 
using ssize_type = std::ptrdiff_t
 
using difference_type = std::ptrdiff_t
 
using pointer = T *
 
using const_pointer = const T *
 
using reference = T &
 
using const_reference = const T &
 
using iterator = pointer
 
using const_iterator = const_pointer
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 

Public Member Functions

constexpr span () noexcept=default
 
constexpr span (pointer ptr, index_type count) noexcept
 
constexpr span (pointer first, pointer last) noexcept
 
SCN_CONSTEXPR14 iterator begin () noexcept
 
SCN_CONSTEXPR14 iterator end () noexcept
 
SCN_CONSTEXPR14 reverse_iterator rbegin () noexcept
 
SCN_CONSTEXPR14 reverse_iterator rend () noexcept
 
constexpr const_iterator begin () const noexcept
 
constexpr const_iterator end () const noexcept
 
constexpr const_reverse_iterator rbegin () const noexcept
 
constexpr const_reverse_iterator rend () const noexcept
 
constexpr const_iterator cbegin () const noexcept
 
constexpr const_iterator cend () const noexcept
 
constexpr const_reverse_iterator crbegin () const noexcept
 
constexpr const_reverse_iterator crend () const noexcept
 
constexpr reference operator[] (index_type i) const noexcept
 
constexpr pointer data () const noexcept
 
constexpr index_type size () const noexcept
 
constexpr ssize_type ssize () const noexcept
 
constexpr span< T > first (index_type n) const
 
constexpr span< T > last (index_type n) const
 
constexpr span< T > subspan (index_type off) const
 
constexpr span< T > subspan (index_type off, difference_type count) const
 
constexpr span< typename
std::add_const< T >::type > 
as_const () const
 

Detailed Description

template<typename T>
class scn::span< T >

A view over a contiguous range.

Stripped-down version of std::span.

Definition at line 29 of file span.h.

Member Typedef Documentation

template<typename T>
using scn::span< T >::const_iterator = const_pointer

Definition at line 240 of file span.h.

template<typename T>
using scn::span< T >::const_pointer = const T*

Definition at line 233 of file span.h.

template<typename T>
using scn::span< T >::const_reference = const T&

Definition at line 235 of file span.h.

template<typename T>
using scn::span< T >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 242 of file span.h.

template<typename T>
using scn::span< T >::difference_type = std::ptrdiff_t

Definition at line 231 of file span.h.

template<typename T>
using scn::span< T >::element_type = T

Definition at line 227 of file span.h.

template<typename T>
using scn::span< T >::index_type = std::size_t

Definition at line 229 of file span.h.

template<typename T>
using scn::span< T >::iterator = pointer

Definition at line 239 of file span.h.

template<typename T>
using scn::span< T >::pointer = T*

Definition at line 232 of file span.h.

template<typename T>
using scn::span< T >::reference = T&

Definition at line 234 of file span.h.

template<typename T>
using scn::span< T >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 241 of file span.h.

template<typename T>
using scn::span< T >::ssize_type = std::ptrdiff_t

Definition at line 230 of file span.h.

template<typename T>
using scn::span< T >::value_type = typename std::remove_cv<T>::type

Definition at line 228 of file span.h.

Constructor & Destructor Documentation

template<typename T>
constexpr scn::span< T >::span ( )
defaultnoexcept
template<typename T>
constexpr scn::span< T >::span ( pointer  ptr,
index_type  count 
)
inlinenoexcept

Definition at line 245 of file span.h.

template<typename T>
constexpr scn::span< T >::span ( pointer  first,
pointer  last 
)
inlinenoexcept

Definition at line 249 of file span.h.

Member Function Documentation

template<typename T>
constexpr span<typename std::add_const<T>::type> scn::span< T >::as_const ( ) const
inline

Definition at line 346 of file span.h.

template<typename T>
SCN_CONSTEXPR14 iterator scn::span< T >::begin ( )
inlinenoexcept

Definition at line 254 of file span.h.

template<typename T>
constexpr const_iterator scn::span< T >::begin ( ) const
inlinenoexcept

Definition at line 271 of file span.h.

template<typename T>
constexpr const_iterator scn::span< T >::cbegin ( ) const
inlinenoexcept

Definition at line 288 of file span.h.

template<typename T>
constexpr const_iterator scn::span< T >::cend ( ) const
inlinenoexcept

Definition at line 292 of file span.h.

template<typename T>
constexpr const_reverse_iterator scn::span< T >::crbegin ( ) const
inlinenoexcept

Definition at line 296 of file span.h.

template<typename T>
constexpr const_reverse_iterator scn::span< T >::crend ( ) const
inlinenoexcept

Definition at line 300 of file span.h.

template<typename T>
constexpr pointer scn::span< T >::data ( ) const
inlinenoexcept

Definition at line 311 of file span.h.

template<typename T>
SCN_CONSTEXPR14 iterator scn::span< T >::end ( )
inlinenoexcept

Definition at line 258 of file span.h.

template<typename T>
constexpr const_iterator scn::span< T >::end ( ) const
inlinenoexcept

Definition at line 275 of file span.h.

template<typename T>
constexpr span<T> scn::span< T >::first ( index_type  n) const
inline

Definition at line 324 of file span.h.

template<typename T>
constexpr span<T> scn::span< T >::last ( index_type  n) const
inline

Definition at line 329 of file span.h.

template<typename T>
constexpr reference scn::span< T >::operator[] ( index_type  i) const
inlinenoexcept

Definition at line 305 of file span.h.

template<typename T>
SCN_CONSTEXPR14 reverse_iterator scn::span< T >::rbegin ( )
inlinenoexcept

Definition at line 262 of file span.h.

template<typename T>
constexpr const_reverse_iterator scn::span< T >::rbegin ( ) const
inlinenoexcept

Definition at line 279 of file span.h.

template<typename T>
SCN_CONSTEXPR14 reverse_iterator scn::span< T >::rend ( )
inlinenoexcept

Definition at line 266 of file span.h.

template<typename T>
constexpr const_reverse_iterator scn::span< T >::rend ( ) const
inlinenoexcept

Definition at line 283 of file span.h.

template<typename T>
constexpr index_type scn::span< T >::size ( ) const
inlinenoexcept

Definition at line 315 of file span.h.

template<typename T>
constexpr ssize_type scn::span< T >::ssize ( ) const
inlinenoexcept

Definition at line 319 of file span.h.

template<typename T>
constexpr span<T> scn::span< T >::subspan ( index_type  off) const
inline

Definition at line 334 of file span.h.

template<typename T>
constexpr span<T> scn::span< T >::subspan ( index_type  off,
difference_type  count 
) const
inline

Definition at line 339 of file span.h.


The documentation for this class was generated from the following file: