An array wrapper for easy copying, comparing, and iterating.
More...
#include <Array.hpp>
|
T & | operator[] (size_t index) |
| Get the element at the given index. More...
|
|
const T & | operator[] (size_t index) const |
| Get the element at the given index. More...
|
|
T * | begin () |
| Get a pointer to the first element. More...
|
|
const T * | begin () const |
| Get a pointer to the first element. More...
|
|
T * | end () |
| Get a pointer to the memory beyond the array. More...
|
|
const T * | end () const |
| Get a pointer to the memory beyond the array. More...
|
|
bool | operator== (const Array< T, N > &rhs) const |
| Check the equality of all elements in two arrays. More...
|
|
bool | operator!= (const Array< T, N > &rhs) const |
| Check the inequality of all elements in two arrays. More...
|
|
|
constexpr static size_t | length = N |
|
template<class T, size_t N>
struct Array< T, N >
An array wrapper for easy copying, comparing, and iterating.
- Template Parameters
-
T | The type of the elements in the array. |
N | The number of elements in the array. |
- Examples
- 10.Note-FastLED-ColorMapper.ino, 9.Note-FastLED.ino, and Bank-Button-Matrix.ino.
Definition at line 20 of file Array.hpp.
◆ type
template<class T, size_t N>
◆ operator[]() [1/2]
template<class T, size_t N>
T& Array< T, N >::operator[] |
( |
size_t |
index | ) |
|
|
inline |
Get the element at the given index.
- Note
- Bounds checking is performed. If fatal errors are disabled, the last element is returned if the index is out of bounds.
- Parameters
-
index | The (zero-based) index of the element to return. |
Definition at line 34 of file Array.hpp.
◆ operator[]() [2/2]
template<class T, size_t N>
const T& Array< T, N >::operator[] |
( |
size_t |
index | ) |
const |
|
inline |
Get the element at the given index.
- Note
- Bounds checking is performed. If fatal errors are disabled, the last element is returned if the index is out of bounds.
- Parameters
-
index | The (zero-based) index of the element to return. |
Definition at line 51 of file Array.hpp.
◆ begin() [1/2]
template<class T, size_t N>
T* Array< T, N >::begin |
( |
| ) |
|
|
inline |
Get a pointer to the first element.
Definition at line 62 of file Array.hpp.
◆ begin() [2/2]
template<class T, size_t N>
const T* Array< T, N >::begin |
( |
| ) |
const |
|
inline |
Get a pointer to the first element.
Definition at line 67 of file Array.hpp.
◆ end() [1/2]
template<class T, size_t N>
T* Array< T, N >::end |
( |
| ) |
|
|
inline |
Get a pointer to the memory beyond the array.
Definition at line 72 of file Array.hpp.
◆ end() [2/2]
template<class T, size_t N>
const T* Array< T, N >::end |
( |
| ) |
const |
|
inline |
Get a pointer to the memory beyond the array.
Definition at line 77 of file Array.hpp.
◆ operator==()
template<class T, size_t N>
bool Array< T, N >::operator== |
( |
const Array< T, N > & |
rhs | ) |
const |
|
inline |
Check the equality of all elements in two arrays.
- Parameters
-
rhs | The array to compare this array to. |
Definition at line 85 of file Array.hpp.
◆ operator!=()
template<class T, size_t N>
bool Array< T, N >::operator!= |
( |
const Array< T, N > & |
rhs | ) |
const |
|
inline |
Check the inequality of all elements in two arrays.
- Parameters
-
rhs | The array to compare this array to. |
Definition at line 100 of file Array.hpp.
◆ data
template<class T, size_t N>
◆ length
template<class T, size_t N>
constexpr static size_t Array< T, N >::length = N |
|
staticconstexpr |
The documentation for this struct was generated from the following file: