Bitcoin Core  0.18.99
P2P Digital Currency
Public Member Functions | Private Attributes | Friends | List of all members
Span< C > Class Template Reference

A Span is an object that can refer to a contiguous sequence of objects. More...

#include <span.h>

Public Member Functions

constexpr Span () noexcept
 
constexpr Span (C *data, std::ptrdiff_t size) noexcept
 
constexpr Span (C *data, C *end) noexcept
 
constexpr C * data () const noexcept
 
constexpr C * begin () const noexcept
 
constexpr C * end () const noexcept
 
constexpr std::ptrdiff_t size () const noexcept
 
constexpr C & operator[] (std::ptrdiff_t pos) const noexcept
 
constexpr Span< C > subspan (std::ptrdiff_t offset) const noexcept
 
constexpr Span< C > subspan (std::ptrdiff_t offset, std::ptrdiff_t count) const noexcept
 
constexpr Span< C > first (std::ptrdiff_t count) const noexcept
 
constexpr Span< C > last (std::ptrdiff_t count) const noexcept
 

Private Attributes

C * m_data
 
std::ptrdiff_t m_size
 

Friends

constexpr bool operator== (const Span &a, const Span &b) noexcept
 
constexpr bool operator!= (const Span &a, const Span &b) noexcept
 
constexpr bool operator< (const Span &a, const Span &b) noexcept
 
constexpr bool operator<= (const Span &a, const Span &b) noexcept
 
constexpr bool operator> (const Span &a, const Span &b) noexcept
 
constexpr bool operator>= (const Span &a, const Span &b) noexcept
 

Detailed Description

template<typename C>
class Span< C >

A Span is an object that can refer to a contiguous sequence of objects.

It implements a subset of C++20's std::span.

Definition at line 17 of file span.h.

Constructor & Destructor Documentation

◆ Span() [1/3]

template<typename C>
constexpr Span< C >::Span ( )
inlinenoexcept

Definition at line 23 of file span.h.

◆ Span() [2/3]

template<typename C>
constexpr Span< C >::Span ( C *  data,
std::ptrdiff_t  size 
)
inlinenoexcept

Definition at line 24 of file span.h.

◆ Span() [3/3]

template<typename C>
constexpr Span< C >::Span ( C *  data,
C *  end 
)
inlinenoexcept

Definition at line 25 of file span.h.

Member Function Documentation

◆ begin()

template<typename C>
constexpr C* Span< C >::begin ( ) const
inlinenoexcept

Definition at line 28 of file span.h.

Here is the caller graph for this function:

◆ data()

template<typename C>
constexpr C* Span< C >::data ( ) const
inlinenoexcept

Definition at line 27 of file span.h.

Here is the caller graph for this function:

◆ end()

template<typename C>
constexpr C* Span< C >::end ( ) const
inlinenoexcept

Definition at line 29 of file span.h.

◆ first()

template<typename C>
constexpr Span<C> Span< C >::first ( std::ptrdiff_t  count) const
inlinenoexcept

Definition at line 35 of file span.h.

◆ last()

template<typename C>
constexpr Span<C> Span< C >::last ( std::ptrdiff_t  count) const
inlinenoexcept

Definition at line 36 of file span.h.

◆ operator[]()

template<typename C>
constexpr C& Span< C >::operator[] ( std::ptrdiff_t  pos) const
inlinenoexcept

Definition at line 31 of file span.h.

◆ size()

template<typename C>
constexpr std::ptrdiff_t Span< C >::size ( ) const
inlinenoexcept

Definition at line 30 of file span.h.

Here is the caller graph for this function:

◆ subspan() [1/2]

template<typename C>
constexpr Span<C> Span< C >::subspan ( std::ptrdiff_t  offset) const
inlinenoexcept

Definition at line 33 of file span.h.

◆ subspan() [2/2]

template<typename C>
constexpr Span<C> Span< C >::subspan ( std::ptrdiff_t  offset,
std::ptrdiff_t  count 
) const
inlinenoexcept

Definition at line 34 of file span.h.

Friends And Related Function Documentation

◆ operator!=

template<typename C>
constexpr bool operator!= ( const Span< C > &  a,
const Span< C > &  b 
)
friend

Definition at line 39 of file span.h.

◆ operator<

template<typename C>
constexpr bool operator< ( const Span< C > &  a,
const Span< C > &  b 
)
friend

Definition at line 40 of file span.h.

◆ operator<=

template<typename C>
constexpr bool operator<= ( const Span< C > &  a,
const Span< C > &  b 
)
friend

Definition at line 41 of file span.h.

◆ operator==

template<typename C>
constexpr bool operator== ( const Span< C > &  a,
const Span< C > &  b 
)
friend

Definition at line 38 of file span.h.

◆ operator>

template<typename C>
constexpr bool operator> ( const Span< C > &  a,
const Span< C > &  b 
)
friend

Definition at line 42 of file span.h.

◆ operator>=

template<typename C>
constexpr bool operator>= ( const Span< C > &  a,
const Span< C > &  b 
)
friend

Definition at line 43 of file span.h.

Member Data Documentation

◆ m_data

template<typename C>
C* Span< C >::m_data
private

Definition at line 19 of file span.h.

◆ m_size

template<typename C>
std::ptrdiff_t Span< C >::m_size
private

Definition at line 20 of file span.h.


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