Invariant for default construction

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Mon Nov 17 12:32:32 PST 2014


On 11/17/14 3:02 PM, Martin Nowak wrote:
> Walter is about to fix an old bug [1] so that invariants are now called
> before destruction and for non-default construction.

This sounds good.

> A remaining question is whether invariants should also be called for
> default construction [2].

I'd say no. There are better ways to test for valid data in the .init 
version of the object/struct that don't involve a runtime check.

-Steve


More information about the Digitalmars-d mailing list