C++26: Trivial infinite loops are no longer undefined behaviour
Thread
Unofficial Hacker News client; not affiliated with Y Combinator.
C++26: Trivial infinite loops are no longer undefined behaviour
Unofficial Hacker News client; not affiliated with Y Combinator.
BobbyTables2 · · focus · HN ↗
Idiots!
Don’t they really that people write real programs to solve real problems? This isn’t a theoretical academic exercise!
Panzerschrek · · focus · HN ↗
An infinite loop which does nothing is practically useless. So, compilers optimize it out. That's the whole philosophy of modern compilers - to reduce execution time by preserving semantics. In case of an infinite loop elimination it's an optimization making code infinite times faster.
chrystalkey · · focus · HN ↗