Tech article
C++26: Trivial infinite loops are no longer undefined behaviour
No preview is available. Read the original article for the full story.
Hacker News | Sep 17, 2026 | ibobev
Automated excerpt
A while (true); loop with no side effects used to be undefined behaviour. Under the pre-C++26 forward-progress rules, an execution that remains in such a loop forever has undefined behaviour. So while (1); is well-defined in C11 and ever since. C++ never adopted that extra rule.
Selected automatically from source text; not independently written or fact-checked. Read the original for full context.