`restricted` member variables

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Jun 20 11:57:23 UTC 2022


On Monday, 20 June 2022 at 11:28:45 UTC, Mike Parker wrote:
> If my only invariant is the state of a single member variable, 
> then I really only want it checked on the function(s) that 
> actually write to it.

Do you want all this complexity just to avoid using «hidden» for 
marking fields class-private?

Also, you need to be able to disable invariants, which adds even 
more complexity.






More information about the Digitalmars-d mailing list