On Wednesday, 7 September 2016 at 21:05:32 UTC, Walter Bright wrote:
The reasons D structs don't have a default constructor:

1. So S.init is a valid initializer
2. So all instances of S can be guaranteed to contain a valid instance
3. So default initialization is guaranteed to succeed
4. So any struct constructor starts with a valid state
5. In my not-so-humble opinion, construction should never fail and all constructors should be nothrow, but I understand that is a minority viewpoint

Assumptions 1..4 are pervasive in D and the logic of the compiler.

What, precisely, does "valid" mean in the above?

Reply via email to