‹ BackHN Continuity

Thread

C++26: Trivial infinite loops are no longer undefined behaviour

173 points · 290 comments · ibobev

  1. Aardwolf · · focus · HN ↗
    > the implementation may assume any thread will eventually do one of the following: terminate, call a library I/O function, access a volatile glvalue, or perform a synchronization or atomic operation

    Why is that rule needed? I could make my for loop try to solve the halting problem and it'll never finish either, circumventing that rule

    1. layer8 · · focus · HN ↗
      See <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49760653">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=49760653.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.