Ranges in C++ can carry more overhead than necessary, resulting from the fixed loop structure and the limitations inherent in the current customization points. The post proposes two solutions: using Flux, a library that offers an enhanced iteration model, and experimenting with Token Sequences, which allows more flexible code generation. Flux implements internal iteration by iterating over ranges with a `for_each` loop, reducing unnecessary overheads, while Token Sequences aim to inject the right loop structure directly into the code.
Table of contents
The ProblemThe Sane Solution: FluxThe Wild Solution: Token SequencesWhere Do We Go From HereSort: