News for hackers. Stuff that matters.
Re:Initialization in C++ is Seriously Bonkers by kllrnohj on Monday January 07, 2019 @09:07PM (#18852454)
> The only reasonable default value, sometimes, is all-zeroes (or all-ones...).

That's very false. Consider a basic string container with a small-size optimization. The default value for capacity is neither 0 nor 1, but the size of the inline array.

Similarly it could be an enum value, and the default for a given class isn't whatever the 0 value happened to line up with because that's arbitrary anyway. An example being a basic type id of a fixed number of types.

There are no comments on this comment yet.