ゴミ箱
Public Types | Public Member Functions | List of all members
boost::beast::span< T > Class Template Reference

#include <span.hpp>

Public Types

using element_type = T
 The type of value, including cv qualifiers. More...
 
using value_type = typename std::remove_const< T >::type
 The type of value of each span element. More...
 
using index_type = std::ptrdiff_t
 The type of integer used to index the span. More...
 
using pointer = T *
 A pointer to a span element. More...
 
using reference = T &
 A reference to a span element. More...
 
using iterator = pointer
 The iterator used by the container. More...
 
using const_pointer = T const *
 The const pointer used by the container. More...
 
using const_reference = T const &
 The const reference used by the container. More...
 
using const_iterator = const_pointer
 The const iterator used by the container. More...
 

Public Member Functions

 span ()=default
 Constructor. More...
 
 span (span const &)=default
 Constructor. More...
 
spanoperator= (span const &)=default
 Assignment. More...
 
 span (T *data, std::size_t size)
 
template<class ContiguousContainer , class = typename std::enable_if< detail::is_contiguous_container< ContiguousContainer, T>::value>::type>
 span (ContiguousContainer &&container)
 
template<class CharT , class Traits , class Allocator >
 span (std::basic_string< CharT, Traits, Allocator > &s)
 
template<class CharT , class Traits , class Allocator >
 span (std::basic_string< CharT, Traits, Allocator > const &s)
 
template<class ContiguousContainer >
std::enable_if< detail::is_contiguous_container< ContiguousContainer, T >::value, span & >::type operator= (ContiguousContainer &&container)
 
template<class CharT , class Traits , class Allocator >
spanoperator= (std::basic_string< CharT, Traits, Allocator > &s)
 
template<class CharT , class Traits , class Allocator >
spanoperator= (std::basic_string< CharT, Traits, Allocator > const &s)
 
bool empty () const
 Returns true if the span is empty. More...
 
T * data () const
 Returns a pointer to the beginning of the span. More...
 
std::size_t size () const
 Returns the number of elements in the span. More...
 
const_iterator begin () const
 Returns an iterator to the beginning of the span. More...
 
const_iterator cbegin () const
 Returns an iterator to the beginning of the span. More...
 
const_iterator end () const
 Returns an iterator to one past the end of the span. More...
 
const_iterator cend () const
 Returns an iterator to one past the end of the span. More...
 

Detailed Description

template<class T>
class boost::beast::span< T >

A range of bytes expressed as a ContiguousContainer

This class implements a non-owning reference to a storage area of a certain size and having an underlying integral type with size of 1.

Template Parameters
TThe type pointed to by span iterators

Member Typedef Documentation

template<class T >
using boost::beast::span< T >::const_iterator = const_pointer

The const iterator used by the container.

template<class T >
using boost::beast::span< T >::const_pointer = T const*

The const pointer used by the container.

template<class T >
using boost::beast::span< T >::const_reference = T const&

The const reference used by the container.

template<class T >
using boost::beast::span< T >::element_type = T

The type of value, including cv qualifiers.

template<class T >
using boost::beast::span< T >::index_type = std::ptrdiff_t

The type of integer used to index the span.

template<class T >
using boost::beast::span< T >::iterator = pointer

The iterator used by the container.

template<class T >
using boost::beast::span< T >::pointer = T*

A pointer to a span element.

template<class T >
using boost::beast::span< T >::reference = T&

A reference to a span element.

template<class T >
using boost::beast::span< T >::value_type = typename std::remove_const<T>::type

The type of value of each span element.

Constructor & Destructor Documentation

template<class T >
boost::beast::span< T >::span ( )
default

Constructor.

template<class T >
boost::beast::span< T >::span ( span< T > const &  )
default

Constructor.

template<class T >
boost::beast::span< T >::span ( T *  data,
std::size_t  size 
)
inline

Constructor

Parameters
dataA pointer to the beginning of the range of elements
sizeThe number of elements pointed to by data
template<class T >
template<class ContiguousContainer , class = typename std::enable_if< detail::is_contiguous_container< ContiguousContainer, T>::value>::type>
boost::beast::span< T >::span ( ContiguousContainer &&  container)
inlineexplicit

Constructor

Parameters
containerThe container to construct from
template<class T >
template<class CharT , class Traits , class Allocator >
boost::beast::span< T >::span ( std::basic_string< CharT, Traits, Allocator > &  s)
inlineexplicit
template<class T >
template<class CharT , class Traits , class Allocator >
boost::beast::span< T >::span ( std::basic_string< CharT, Traits, Allocator > const &  s)
inlineexplicit

Member Function Documentation

template<class T >
const_iterator boost::beast::span< T >::begin ( ) const
inline

Returns an iterator to the beginning of the span.

template<class T >
const_iterator boost::beast::span< T >::cbegin ( ) const
inline

Returns an iterator to the beginning of the span.

template<class T >
const_iterator boost::beast::span< T >::cend ( ) const
inline

Returns an iterator to one past the end of the span.

template<class T >
T* boost::beast::span< T >::data ( ) const
inline

Returns a pointer to the beginning of the span.

template<class T >
bool boost::beast::span< T >::empty ( ) const
inline

Returns true if the span is empty.

template<class T >
const_iterator boost::beast::span< T >::end ( ) const
inline

Returns an iterator to one past the end of the span.

template<class T >
span& boost::beast::span< T >::operator= ( span< T > const &  )
default

Assignment.

template<class T >
template<class ContiguousContainer >
std::enable_if<detail::is_contiguous_container< ContiguousContainer, T>::value, span&>::type boost::beast::span< T >::operator= ( ContiguousContainer &&  container)
inline

Assignment

Parameters
containerThe container to assign from
template<class T >
template<class CharT , class Traits , class Allocator >
span& boost::beast::span< T >::operator= ( std::basic_string< CharT, Traits, Allocator > &  s)
inline
template<class T >
template<class CharT , class Traits , class Allocator >
span& boost::beast::span< T >::operator= ( std::basic_string< CharT, Traits, Allocator > const &  s)
inline
template<class T >
std::size_t boost::beast::span< T >::size ( ) const
inline

Returns the number of elements in the span.


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