by ks6g10 · 1mo ago · 0 comments
But then input handling is much more complex than output handling.
Also, 26 now initialises trivial variables with erroneous values, and is no longer undefined behaviour to act on them.
This is only partially true. From the proposal [0]:
> Moreover, a variable that has a well-defined, erroneous initial object representation under this proposal can still lead to undefined behaviour later on:
void f(T&);
void g(bool);
void h() {
T* p; // uninitialized, has erroneous value (e.g. null)
bool b; // uninitialized, erroneous value may not be valid bool
f(*p); // dereferencing has undefined behaviour
g(b); // undefined behaviour if b is invalid
}
[0]: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p27...