Speeduino
Loading...
Searching...
No Matches
Classes
static_for.hpp File Reference

A compile time unrolled loop. More...

#include <stdint.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  static_for< from, to >
 Generate a fixed number of calls to a given free function at compile time. More...
 

Detailed Description

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

See also
https://godbolt.org/z/6KGWajPaY