Using closure in function scope to make "real" private class members

Commander Zot no at no.no
Mon Jun 6 15:14:54 UTC 2022


On Sunday, 5 June 2022 at 06:08:10 UTC, forkit wrote:
> On Sunday, 5 June 2022 at 04:49:44 UTC, forkit wrote:
>>[...]
>
> btw.
>
> here is a simple example, for demonstration purposes only, of 
> the change that I'd like to see in D:
>
> [...]

may I suggest you just use the proper tools for enforcing 
invariants?
https://dlang.org/spec/class.html#invariants


More information about the Digitalmars-d mailing list