scnlib  0.1.2
FormattedinputformodernC++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
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 = T *
 
using reference = 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

SCN_CONSTEXPR span () noexcept=default
 
SCN_CONSTEXPR span (pointer ptr, index_type count) noexcept
 
SCN_CONSTEXPR span (pointer first, pointer last) noexcept
 
SCN_CONSTEXPR iterator begin () const noexcept
 
SCN_CONSTEXPR iterator end () const noexcept
 
SCN_CONSTEXPR reverse_iterator rbegin () const noexcept
 
SCN_CONSTEXPR reverse_iterator rend () const noexcept
 
SCN_CONSTEXPR const_iterator cbegin () const noexcept
 
SCN_CONSTEXPR const_iterator cend () const noexcept
 
SCN_CONSTEXPR
const_reverse_iterator 
crbegin () const noexcept
 
SCN_CONSTEXPR
const_reverse_iterator 
crend () const noexcept
 
SCN_CONSTEXPR reference operator[] (index_type i) const noexcept
 
SCN_CONSTEXPR pointer data () const noexcept
 
SCN_CONSTEXPR index_type size () const noexcept
 
SCN_CONSTEXPR ssize_type ssize () const noexcept
 
SCN_CONSTEXPR span< T > first (index_type n) const
 
SCN_CONSTEXPR span< T > last (index_type n) const
 
SCN_CONSTEXPR span< T > subspan (index_type off) const
 
SCN_CONSTEXPR span< T > subspan (index_type off, difference_type count) const
 
SCN_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 33 of file span.h.

Member Typedef Documentation

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

Definition at line 44 of file span.h.

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

Definition at line 41 of file span.h.

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

Definition at line 46 of file span.h.

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

Definition at line 39 of file span.h.

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

Definition at line 35 of file span.h.

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

Definition at line 37 of file span.h.

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

Definition at line 43 of file span.h.

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

Definition at line 40 of file span.h.

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

Definition at line 42 of file span.h.

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

Definition at line 45 of file span.h.

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

Definition at line 38 of file span.h.

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

Definition at line 36 of file span.h.

Constructor & Destructor Documentation

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

Definition at line 49 of file span.h.

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

Definition at line 53 of file span.h.

Member Function Documentation

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

Definition at line 134 of file span.h.

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

Definition at line 58 of file span.h.

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

Definition at line 75 of file span.h.

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

Definition at line 79 of file span.h.

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

Definition at line 83 of file span.h.

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

Definition at line 87 of file span.h.

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

Definition at line 98 of file span.h.

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

Definition at line 62 of file span.h.

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

Definition at line 111 of file span.h.

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

Definition at line 116 of file span.h.

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

Definition at line 92 of file span.h.

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

Definition at line 66 of file span.h.

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

Definition at line 70 of file span.h.

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

Definition at line 102 of file span.h.

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

Definition at line 106 of file span.h.

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

Definition at line 121 of file span.h.

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

Definition at line 126 of file span.h.


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