Constancy of invariants

deadalnix deadalnix at gmail.com
Sun Jan 29 10:13:12 PST 2012


Le 29/01/2012 17:46, Daniel Murphy a écrit :
>> And what's your view?  Should we make invariants automatically const?
> Yes, probably.  Once downside is that any private methods you want to call
> will need to be const-correct.  Invariants being const is much less
> restricting than forcing them to be pure/nothrow/safe.
>

Well, this is required if you want the class to be constable at all, 
whatever the invariant require it or not. So I'd argue that invraiant 
should be automatically const.

This is very important to improve D2 and its lib to be more const 
compliant, and this is a step in the right direction.


More information about the Digitalmars-d mailing list