Mistake on this page?
Report an issue in GitHub or email us
Data Structures | Functions | Variables
Span class

Data Structures

struct  Span< ElementType, Extent >
 Nonowning view to a sequence of contiguous elements. More...
 
struct  Span< ElementType, SPAN_DYNAMIC_EXTENT >
 Span specialization that handle dynamic size. More...
 

Functions

template<typename T , ptrdiff_t LhsExtent, ptrdiff_t RhsExtent>
bool operator== (const Span< T, LhsExtent > &lhs, T(&rhs)[RhsExtent])
 Equality operation between a Span and a reference to a C++ array. More...
 
template<typename T , ptrdiff_t LhsExtent, ptrdiff_t RhsExtent>
bool operator== (T(&lhs)[LhsExtent], const Span< T, RhsExtent > &rhs)
 Equality operation between a Span and a reference to a C++ array. More...
 
template<typename T , ptrdiff_t LhsExtent, ptrdiff_t RhsExtent>
bool operator!= (const Span< T, LhsExtent > &lhs, T(&rhs)[RhsExtent])
 Not Equal operation between a Span and a reference to a C++ array. More...
 
template<typename T , ptrdiff_t LhsExtent, ptrdiff_t RhsExtent>
bool operator!= (T(&lhs)[LhsExtent], const Span< T, RhsExtent > &rhs)
 Not Equal operation between a Span and a reference to a C++ array. More...
 
template<ptrdiff_t Extent, typename T >
Span< T, Extent > make_Span (T *elements)
 Generate a Span from a pointer to a C/C++ array. More...
 
template<typename T , size_t Extent>
Span< const T, Extent > make_const_Span (const T(&elements)[Extent])
 Generate a Span to a const content from a reference to a C/C++ array. More...
 
template<typename T , typename U , ptrdiff_t LhsExtent, ptrdiff_t RhsExtent>
bool operator== (const Span< T, LhsExtent > &lhs, const Span< U, RhsExtent > &rhs)
 Equality operator between two Span objects. More...
 
template<typename T , typename U , ptrdiff_t LhsExtent, ptrdiff_t RhsExtent>
bool operator!= (const Span< T, LhsExtent > &lhs, const Span< U, RhsExtent > &rhs)
 Not equal operator. More...
 
template<typename T , size_t Size>
Span< T, Size > make_Span (T(&elements)[Size])
 Generate a Span from a reference to a C/C++ array. More...
 
template<typename T >
Span< T > make_Span (T *array_ptr, ptrdiff_t array_size)
 Generate a Span from a C/C++ pointer and the size of the array. More...
 
template<size_t Extent, typename T >
Span< const T, Extent > make_const_Span (const T *elements)
 Generate a Span to a const content from a pointer to a C/C++ array. More...
 
template<typename T >
Span< const T > make_const_Span (T *array_ptr, size_t array_size)
 Generate a Span to a const content from a C/C++ pointer and the size of the array. More...
 

Variables

const ptrdiff_t SPAN_DYNAMIC_EXTENT = -1
 Special value for the Extent parameter of Span. More...
 

Detailed Description

Function Documentation

Span<const T, Extent> mbed::make_const_Span ( const T(&)  elements[Extent])

Generate a Span to a const content from a reference to a C/C++ array.

Template Parameters
TType of elements held in elements.
ExtentNumber of items held in elements.
Parameters
elementsThe array viewed.
Returns
The Span to elements.
Note
This helper avoids the typing of template parameter when Span is created 'inline'.

Definition at line 972 of file Span.h.

Span< const T, Extent > make_const_Span ( const T *  elements)
related

Generate a Span to a const content from a pointer to a C/C++ array.

Template Parameters
ExtentNumber of items held in elements.
TType of elements held in elements.
Parameters
elementsThe reference to the array viewed.
Returns
The Span to elements.
Note
This helper avoids the typing of template parameter when Span is created 'inline'.

Definition at line 993 of file Span.h.

Span< const T > make_const_Span ( T *  array_ptr,
size_t  array_size 
)
related

Generate a Span to a const content from a C/C++ pointer and the size of the array.

Template Parameters
TType of elements held in array_ptr.
Parameters
array_ptrThe pointer to the array to viewed.
array_sizeThe number of T elements in the array.
Returns
The Span to array_ptr with a size of array_size.
Note
This helper avoids the typing of template parameter when Span is created 'inline'.

Definition at line 1015 of file Span.h.

Span< T, Size > make_Span ( T(&)  elements[Size])
related

Generate a Span from a reference to a C/C++ array.

Template Parameters
TType of elements held in elements.
ExtentNumber of items held in elements.
Parameters
elementsThe reference to the array viewed.
Returns
The Span to elements.
Note
This helper avoids the typing of template parameter when Span is created 'inline'.

Definition at line 914 of file Span.h.

Span<T, Extent> mbed::make_Span ( T *  elements)

Generate a Span from a pointer to a C/C++ array.

Template Parameters
ExtentNumber of items held in elements.
TType of elements held in elements.
Parameters
elementsThe reference to the array viewed.
Returns
The Span to elements.
Note
This helper avoids the typing of template parameter when Span is created 'inline'.

Definition at line 933 of file Span.h.

Span< T > make_Span ( T *  array_ptr,
ptrdiff_t  array_size 
)
related

Generate a Span from a C/C++ pointer and the size of the array.

Template Parameters
TType of elements held in array_ptr.
Parameters
array_ptrThe pointer to the array viewed.
array_sizeThe number of T elements in the array.
Returns
The Span to array_ptr with a size of array_size.
Note
This helper avoids the typing of template parameter when Span is created 'inline'.

Definition at line 954 of file Span.h.

bool operator!= ( const Span< T, LhsExtent > &  lhs,
const Span< U, RhsExtent > &  rhs 
)
related

Not equal operator.

Parameters
lhsLeft side of the binary operation.
rhsRight side of the binary operation.
Returns
True if arrays in input do not have the same size or the same content and false otherwise.

Definition at line 863 of file Span.h.

bool mbed::operator!= ( const Span< T, LhsExtent > &  lhs,
T(&)  rhs[RhsExtent] 
)

Not Equal operation between a Span and a reference to a C++ array.

Parameters
lhsLeft side of the binary operation.
rhsRight side of the binary operation.
Returns
True if elements in input have the same size and the same content and false otherwise.

Definition at line 878 of file Span.h.

bool mbed::operator!= ( T(&)  lhs[LhsExtent],
const Span< T, RhsExtent > &  rhs 
)

Not Equal operation between a Span and a reference to a C++ array.

Parameters
lhsLeft side of the binary operation.
rhsRight side of the binary operation.
Returns
True if elements in input have the same size and the same content and false otherwise.

Definition at line 893 of file Span.h.

bool operator== ( const Span< T, LhsExtent > &  lhs,
const Span< U, RhsExtent > &  rhs 
)
related

Equality operator between two Span objects.

Parameters
lhsLeft side of the binary operation.
rhsRight side of the binary operation.
Returns
True if Spans in input have the same size and the same content and false otherwise.

Definition at line 806 of file Span.h.

bool mbed::operator== ( const Span< T, LhsExtent > &  lhs,
T(&)  rhs[RhsExtent] 
)

Equality operation between a Span and a reference to a C++ array.

Parameters
lhsLeft side of the binary operation.
rhsRight side of the binary operation.
Returns
True if elements in input have the same size and the same content and false otherwise.

Definition at line 831 of file Span.h.

bool mbed::operator== ( T(&)  lhs[LhsExtent],
const Span< T, RhsExtent > &  rhs 
)

Equality operation between a Span and a reference to a C++ array.

Parameters
lhsLeft side of the binary operation.
rhsRight side of the binary operation.
Returns
True if elements in input have the same size and the same content and false otherwise.

Definition at line 846 of file Span.h.

Variable Documentation

const ptrdiff_t SPAN_DYNAMIC_EXTENT = -1
related

Special value for the Extent parameter of Span.

If the type uses this value, then the size of the array is stored in the object at runtime.

Definition at line 68 of file Span.h.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.