What is the case against a struct post-blit default constructor?

monarch_dodra monarchdodra at gmail.com
Fri Oct 12 14:08:26 PDT 2012


On Friday, 12 October 2012 at 20:33:11 UTC, Era Scarecrow wrote:
>  I'll say a @novariant is the better answer, and automatically 
> used on the default copy/opAssign/postblitz (before the call, 
> but still needed after).

The language already states that the invariant is only called at 
the end of construction (ergo copy/postblit).

opAssign, IMO, is not (much) different than any other function. 
invariant checks should be disabled on it, if and when the 
developer explicitly requests it. That's the safest route anyway.


More information about the Digitalmars-d mailing list