‹ BackHN Continuity

Thread

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

173 points · 290 comments · ibobev

  1. bitbasher · · focus · HN ↗
    If an infinite loop can be both:

    1. An infinite busy loop.

    2. A thread yield/sleep.

    It is by definition undefined behavior. You don't know what you're going to get!

    1. cppcppcpp · · focus · HN ↗
      You know what you’re getting, the code is right there!
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.