![]() |
Speeduino
|
A compile time unrolled loop. More...
#include <stdint.h>#include <utility>#include <initializer_list>Go to the source code of this file.
Functions | |
| template<uint8_t N, typename F > | |
| static void | static_for (F &&f) |
| Generate a fixed number of calls to a given free function at compile time. | |
A compile time unrolled loop.
GCC is surprisingly conservative at unrolling loops with -funroll-loops (and even -funroll-all-loops):
In summary, it's designed for very simple cases where loop overhead is obviously high
|
inlinestatic |
Generate a fixed number of calls to a given free function at compile time.
Usage:
| N | The upper bound (exclusive) |
| F | Callable type |
| f | Callable instance |