4 ms·
Ah, the error was the other way around. The idea that you form a value by creating an uninitialized one and then filling in its fields is dumb. (I suspect the
by lmm 10y ago
Ah, the error was the other way around.
The idea that you form a value by creating an uninitialized one and then filling in its fields is dumb. (I suspect the field value wasn't even 0 as such but rather undefined, and the implementation happened to make it 0?). Better languages have you initialize the value directly and you can't access it until it's fully initialized. C/C++ are just really bad at expressing nontrivial values, even value literals.
(Discarding a value ought to be an error too, though that's more cumbersome to work with)