|
|
|
|
|
by tialaramex
613 days ago
|
|
C++ 26 will (almost certainly, it's in the draft) add Erroneous Behaviour. EB is well defined but definitely wrong, so it's a way for the standard to say: Do not allow this to happen, but if you do, the consequence is definitely that. The specific EB in the C++ 26 draft is the value of default uninitialized primitives. So e.g. int k; std::cout << k << "\n"; In C++ 23 and previous versions that's Undefined Behaviour, maybe it prints the lyrics to the National Anthem of the country where the compiler ran? Maybe it deletes all your files. But in C++ 26 the Erroneous Behaviour is that there's some integer value k, which your compiler vendor knew (and might tell you or even let you change it) and it prints that value, but you're naughty because this is definitively an error when it happens. |
|