Invariant for default construction

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sun Dec 21 23:45:26 PST 2014


On 12/21/2014 11:18 PM, Daniel Murphy wrote:
> "Walter Bright"  wrote in message news:m753hk$pt2$1 at digitalmars.com...
>
>> Invariants should be checking the state of the object that it owns, not other
>> objects. I would consider such an invariant invalid.
>
> What?  No.
>
> This is a perfectly valid use of invariants:

It all depends on how invariant is defined. It's defined as an invariant on what 
it owns, not whatever is referenced by the object.



More information about the Digitalmars-d mailing list