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

12345swordy alexanderheistermann at gmail.com
Fri Jun 3 16:08:51 UTC 2022


On Friday, 3 June 2022 at 15:41:04 UTC, Mike Parker wrote:
> On Friday, 3 June 2022 at 12:13:47 UTC, forkit wrote:
>
>>
>> Practically speaking, anyone that uses a class in D, must be 
>> put it in its own module - no exceptions.
>
> That's just nonsense.

It isn't nonsense if you want private to encapsulate to the class 
only and not the entire module file. That the technique that you 
*HAVE* to use in D. Unless you don't mind removing the one module 
per file restriction.

-Alex


More information about the Digitalmars-d mailing list