‹ BackHN Continuity

Thread

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

173 points · 290 comments · ibobev

  1. account42 · · focus · HN ↗
    Unfortunate. There isn't ever a good reason to have an infinite loop so concerned compilers could have just diagnosed this as a warning.
    1. weinzierl · · focus · HN ↗
      For Rust the infinite loop is important enough to have its own keyword.
      1. account42 · · focus · HN ↗
        A loop without a terminating condition in the loop header is not the same as a loop that doesn't terminate.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.