FastArduino  v1.8
C++ library to build fast but small Arduino/AVR projects
utils::range< T > Class Template Reference

Iterable class that can embed arrays or initializer lists through implicit conversion. More...

#include <fastarduino/iterator.h>

Detailed Description

template<typename T>
class utils::range< T >

Iterable class that can embed arrays or initializer lists through implicit conversion.

The following samples show an example of function using a range parameter, and an example of how to call this function.

int sum(utils::range<int> numbers) {
int total = 0;
for (int num: numbers) total += num;
return num;
}
...
// Call sum()
int x = sum({1,2,3,4,5});
const int array[] = {10,20,30,40,50,60};
int y = sum(array);
Template Parameters
Ttype of items in this range

Definition at line 50 of file iterator.h.


The documentation for this class was generated from the following file:
utils::range
Iterable class that can embed arrays or initializer lists through implicit conversion.
Definition: iterator.h:51