How to break or continue from a lambda loop? -- Vittorio Romeo
Is it possible to write a simple iteration API that hides implementation details and lets users break and continue?
Here's a new article about a lightweight solution using a `ControlFlow` enumeration!
How to break or continue from a lambda loop?
by Vittorio Romeo
From the article:
Here’s an encapsulation challenge that I frequently run into: how to let users iterate over an internal data structure without leaking implementation details, but still giving them full control over the loop?
Implementing a custom iterator type requires significant boilerplate and/or complexity, depending on the underlying data structure.
Coroutines are simple and elegant, but the codegen is atrocious – definitely unsuitable for hot paths.


Constexpr has been around for a while now, but many don’t fully understand its subtleties. Andreas Fertig explores its use and when a constexpr expression might not be evaluated at compile time.
C++’s undefined behaviour impacts safety. Sandor Dargo explains how and why uninitialised reads will become erroneous behaviour in C++26, rather than being undefined behaviour.
In the December issue of Overload [
Integer division is one of the most expensive operations in C++, but when the divisor is known at compile time, the compiler can optimize it significantly. This post explores different approaches—using templates, lambda expressions, and template metaprogramming—to speed up division while maintaining clean and efficient code.