Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Span class
[Platform]
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. | |
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. | |
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. | |
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. | |
template<ptrdiff_t Extent, typename T > | |
Span< T, Extent > | make_Span (T *elements) |
Generate a Span from a pointer to a C/C++ array. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
Variables | |
const ptrdiff_t | SPAN_DYNAMIC_EXTENT = -1 |
Special value for the Extent parameter of Span. |
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:
-
T Type of elements held in elements. Extent Number of items held in elements.
- Parameters:
-
elements The array viewed.
- Returns:
- The Span to elements.
- Note:
- This helper avoids the typing of template parameter when Span is created 'inline'.
Span< const T, Extent > make_const_Span | ( | const T * | elements ) | [related, inherited] |
Generate a Span to a const content from a pointer to a C/C++ array.
- Template Parameters:
-
Extent Number of items held in elements. T Type of elements held in elements.
- Parameters:
-
elements The reference to the array viewed.
- Returns:
- The Span to elements.
- Note:
- This helper avoids the typing of template parameter when Span is created 'inline'.
Span< const T > make_const_Span | ( | T * | array_ptr, |
size_t | array_size | ||
) | [related, inherited] |
Generate a Span to a const content from a C/C++ pointer and the size of the array.
- Template Parameters:
-
T Type of elements held in array_ptr.
- Parameters:
-
array_ptr The pointer to the array to viewed. array_size The 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'.
Span< T, Size > make_Span | ( | T(&) | elements[Size] ) | [related, inherited] |
Generate a Span from a reference to a C/C++ array.
- Template Parameters:
-
T Type of elements held in elements. Extent Number of items held in elements.
- Parameters:
-
elements The reference to the array viewed.
- Returns:
- The Span to elements.
- Note:
- This helper avoids the typing of template parameter when Span is created 'inline'.
Span< T > make_Span | ( | T * | array_ptr, |
ptrdiff_t | array_size | ||
) | [related, inherited] |
Generate a Span from a C/C++ pointer and the size of the array.
- Template Parameters:
-
T Type of elements held in array_ptr.
- Parameters:
-
array_ptr The pointer to the array viewed. array_size The 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'.
Span<T, Extent> mbed::make_Span | ( | T * | elements ) |
Generate a Span from a pointer to a C/C++ array.
- Template Parameters:
-
Extent Number of items held in elements. T Type of elements held in elements.
- Parameters:
-
elements The reference to the array viewed.
- Returns:
- The Span to elements.
- Note:
- This helper avoids the typing of template parameter when Span is created 'inline'.
bool mbed::operator!= | ( | const Span< T, LhsExtent > & | lhs, |
T(&) | rhs[RhsExtent] | ||
) |
bool mbed::operator!= | ( | T(&) | lhs[LhsExtent], |
const Span< T, RhsExtent > & | rhs | ||
) |
bool mbed::operator== | ( | T(&) | lhs[LhsExtent], |
const Span< T, RhsExtent > & | rhs | ||
) |
bool mbed::operator== | ( | const Span< T, LhsExtent > & | lhs, |
T(&) | rhs[RhsExtent] | ||
) |
Variable Documentation
const ptrdiff_t SPAN_DYNAMIC_EXTENT = -1 [related, inherited] |
Generated on Tue Jul 12 2022 20:53:08 by
