BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsl::span< TYPE, EXTENT > Class Template Reference

#include <bslstl_span.h>

Public Types

typedef TYPE element_type
 
typedef bsl::remove_cv< TYPE >::type value_type
 
typedef size_t size_type
 
typedef ptrdiff_t difference_type
 
typedef TYPE * pointer
 
typedef const TYPE * const_pointer
 
typedef TYPE & reference
 
typedef const TYPE & const_reference
 
typedef pointer iterator
 
typedef bsl::reverse_iterator< iteratorreverse_iterator
 

Public Member Functions

BSLS_KEYWORD_CONSTEXPR_CPP14 span () BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 span (const span &original) BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 span (pointer ptr, size_type count)
 
BSLS_KEYWORD_CONSTEXPR_CPP14 span (pointer first, pointer last)
 
template<size_t SIZE>
BSLS_KEYWORD_CONSTEXPR_CPP14 span (typename Span_Utility::TypeIdentity< element_type >::type(&arr)[SIZE]) BSLS_KEYWORD_NOEXCEPT
 
template<class t_OTHER_TYPE >
BSLS_KEYWORD_CONSTEXPR_CPP14 span (bsl::array< t_OTHER_TYPE, EXTENT > &arr, typename bsl::enable_if< Span_Utility::IsArrayConvertible< t_OTHER_TYPE, element_type >::value, void * >::type=NULL) BSLS_KEYWORD_NOEXCEPT
 
template<class t_OTHER_TYPE >
BSLS_KEYWORD_CONSTEXPR_CPP14 span (const bsl::array< t_OTHER_TYPE, EXTENT > &arr, typename bsl::enable_if< Span_Utility::IsArrayConvertible< const t_OTHER_TYPE, element_type >::value, void * >::type=NULL) BSLS_KEYWORD_NOEXCEPT
 
template<class t_OTHER_TYPE >
BSLS_KEYWORD_CONSTEXPR_CPP14 span (std::array< t_OTHER_TYPE, EXTENT > &arr, typename bsl::enable_if< Span_Utility::IsArrayConvertible< t_OTHER_TYPE, element_type >::value, void * >::type=NULL) BSLS_KEYWORD_NOEXCEPT
 
template<class t_OTHER_TYPE >
BSLS_KEYWORD_CONSTEXPR_CPP14 span (const std::array< t_OTHER_TYPE, EXTENT > &arr, typename bsl::enable_if< Span_Utility::IsArrayConvertible< const t_OTHER_TYPE, element_type >::value, void * >::type=NULL) BSLS_KEYWORD_NOEXCEPT
 
template<class t_OTHER_TYPE >
BSLS_KEYWORD_CONSTEXPR_CPP14 span (const span< t_OTHER_TYPE, EXTENT > &other, typename bsl::enable_if< Span_Utility::IsArrayConvertible< t_OTHER_TYPE, element_type >::value, void * >::type=NULL) BSLS_KEYWORD_NOEXCEPT
 
template<class t_OTHER_TYPE >
BSLS_KEYWORD_CONSTEXPR_CPP14 span (const span< t_OTHER_TYPE, dynamic_extent > &other, typename bsl::enable_if< Span_Utility::IsArrayConvertible< t_OTHER_TYPE, element_type >::value, void * >::type=NULL) BSLS_KEYWORD_NOEXCEPT
 
 ~span () noexcept=default
 Destroy this object.
 
BSLS_KEYWORD_CONSTEXPR_CPP14 reference back () const
 
BSLS_KEYWORD_CONSTEXPR pointer data () const BSLS_KEYWORD_NOEXCEPT
 Return a pointer to the data referenced by this span.
 
BSLS_KEYWORD_CONSTEXPR bool empty () const BSLS_KEYWORD_NOEXCEPT
 
template<size_t COUNT>
BSLS_KEYWORD_CONSTEXPR_CPP14 span< element_type, COUNT > first () const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 span< element_type, dynamic_extentfirst (size_type count) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 reference front () const
 
template<size_t COUNT>
BSLS_KEYWORD_CONSTEXPR_CPP14 span< element_type, COUNT > last () const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 span< element_type, dynamic_extentlast (size_type count) const
 
BSLS_KEYWORD_CONSTEXPR size_type size () const BSLS_KEYWORD_NOEXCEPT
 Return the size of this span.
 
BSLS_KEYWORD_CONSTEXPR size_type size_bytes () const BSLS_KEYWORD_NOEXCEPT
 Return the size of this span in bytes.
 
template<size_t OFFSET, size_t COUNT>
BSLS_KEYWORD_CONSTEXPR_CPP14 Span_Utility::SubspanReturnType< TYPE, EXTENT, COUNT, OFFSET >::type subspan () const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 span< element_type, dynamic_extentsubspan (size_type offset, size_type count=dynamic_extent) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 reference operator[] (size_type index) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 iterator begin () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 iterator end () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 reverse_iterator rbegin () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 reverse_iterator rend () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 spanoperator= (const span &) BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 void swap (span &other) BSLS_KEYWORD_NOEXCEPT
 
template<class t_OTHER_TYPE >
BSLS_KEYWORD_CONSTEXPR_CPP14 span (const bsl::span< t_OTHER_TYPE, bsl::dynamic_extent > &other, typename bsl::enable_if< Span_Utility::IsArrayConvertible< t_OTHER_TYPE, element_type >::value, void * >::type) BSLS_KEYWORD_NOEXCEPT
 
template<size_t COUNT>
BSLS_KEYWORD_CONSTEXPR_CPP14 bsl::span< TYPE, COUNT > first () const
 
template<size_t COUNT>
BSLS_KEYWORD_CONSTEXPR_CPP14 bsl::span< TYPE, COUNT > last () const
 
template<size_t OFFSET, size_t COUNT>
BSLS_KEYWORD_CONSTEXPR_CPP14 bsl::span< TYPE, COUNT > subspan () const
 

Static Public Attributes

static const size_type extent = EXTENT
 

Member Typedef Documentation

◆ const_pointer

template<class TYPE , size_t EXTENT>
typedef const TYPE* bsl::span< TYPE, EXTENT >::const_pointer

◆ const_reference

template<class TYPE , size_t EXTENT>
typedef const TYPE& bsl::span< TYPE, EXTENT >::const_reference

◆ difference_type

template<class TYPE , size_t EXTENT>
typedef ptrdiff_t bsl::span< TYPE, EXTENT >::difference_type

◆ element_type

template<class TYPE , size_t EXTENT>
typedef TYPE bsl::span< TYPE, EXTENT >::element_type

◆ iterator

template<class TYPE , size_t EXTENT>
typedef pointer bsl::span< TYPE, EXTENT >::iterator

◆ pointer

template<class TYPE , size_t EXTENT>
typedef TYPE* bsl::span< TYPE, EXTENT >::pointer

◆ reference

template<class TYPE , size_t EXTENT>
typedef TYPE& bsl::span< TYPE, EXTENT >::reference

◆ reverse_iterator

template<class TYPE , size_t EXTENT>
typedef bsl::reverse_iterator<iterator> bsl::span< TYPE, EXTENT >::reverse_iterator

◆ size_type

template<class TYPE , size_t EXTENT>
typedef size_t bsl::span< TYPE, EXTENT >::size_type

◆ value_type

template<class TYPE , size_t EXTENT>
typedef bsl::remove_cv<TYPE>::type bsl::span< TYPE, EXTENT >::value_type

Constructor & Destructor Documentation

◆ span()

template<class TYPE , size_t EXTENT>
template<class t_OTHER_TYPE >
BSLS_KEYWORD_CONSTEXPR_CPP14 bsl::span< TYPE, EXTENT >::span ( const span< t_OTHER_TYPE, dynamic_extent > &  other,
typename bsl::enable_if< Span_Utility::IsArrayConvertible< t_OTHER_TYPE, element_type >::value, void * >::type  = NULL 
)

Construct a span from the specified span other. This constructor participates in overload resolution only if t_OTHER_TYPE(*)[] is convertible to element_type(*)[]. The behavior is undefined unless other.size() == EXTENT.

◆ ~span()

template<class TYPE , size_t EXTENT>
bsl::span< TYPE, EXTENT >::~span ( )
defaultnoexcept

Member Function Documentation

◆ first()

template<class TYPE , size_t EXTENT>
template<size_t COUNT>
BSLS_KEYWORD_CONSTEXPR_CPP14 span< element_type, COUNT > bsl::span< TYPE, EXTENT >::first ( ) const

Return a statically-sized span consisting of the first COUNT elements of this span. The behavior is undefined unless COUNT <= size().

◆ last()

template<class TYPE , size_t EXTENT>
template<size_t COUNT>
BSLS_KEYWORD_CONSTEXPR_CPP14 span< element_type, COUNT > bsl::span< TYPE, EXTENT >::last ( ) const

Return a statically-sized span consisting of the last COUNT elements of this span. The behavior is undefined unless COUNT <= size().

◆ subspan()

template<class TYPE , size_t EXTENT>
template<size_t OFFSET, size_t COUNT>
BSLS_KEYWORD_CONSTEXPR_CPP14 Span_Utility::SubspanReturnType< TYPE, EXTENT, COUNT, OFFSET >::type bsl::span< TYPE, EXTENT >::subspan ( ) const
inline

If the template parameter COUNT is dynamic_extent , return a dynamically-sized span consisting consisting of the elements of this span in the half-open range [OFFSET, EXTENT). Otherwise, return a statically-sized span consisting of the elements of this span in the half-open range [OFFSET, OFFSET+COUNT). The behavior is undefined unless OFFSET <= EXTENT. If COUNT != dynamic_extent, the behavior is undefined unless OFFSET + COUNT <= EXTENT.

Member Data Documentation

◆ extent

template<class TYPE , size_t EXTENT>
const size_type bsl::span< TYPE, EXTENT >::extent = EXTENT
static

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