December 22, 2014
On 12/21/2014 11:18 PM, Daniel Murphy wrote:
> "Walter Bright"  wrote in message news:m753hk$pt2$1@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.

December 22, 2014
"Walter Bright"  wrote in message news:m78i71$1c2h$1@digitalmars.com...

> 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.

Whether or not it owns the data it references is application specific. Where are you saying the correct place to put a check like my example, to ensure that an owned object correctly references its parent? 

1 2 3
Next ›   Last »