Tag: loops
-
Benefit of endless-loops without side effects in C++ being undefined behavior compared to C?
28 In C++ loops as for(;;) {} are undefined behavior, whereas they are not in C(?). On P2809R0. Trivial infinite loops are not Undefined Behavior, it is expressed that there are good reasons for doing so. Are there any simple examples to make that clear? c++ c loops optimization undefined-behavior Share Improve this question Follow…
-
Benefit of endless-loops without side-effects in C++ being UB compared to C?
19 In C++ loops as for(;;) {} are UB, whereas they are not in C? In https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2809r0.html it is expressed that there are good reasons for doing so. Are there any simple examples to make that clear? c++ c loops optimization undefined-behavior Share Improve this question Follow asked 17 hours ago wimalopaanwimalopaan 4,60811 gold badge1919…