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

bauss jj_1337 at live.dk
Fri Jun 3 10:20:08 UTC 2022


On Friday, 3 June 2022 at 09:02:17 UTC, forkit wrote:
> On Friday, 3 June 2022 at 08:53:08 UTC, forkit wrote:
>>
>
> class myClass
> {
>     _really_private string _ID;
> }

Perhaps something like:

```
class Foo
{
     private class string _id; // Private to the class
}
```

```
class Foo
{
     private module string _id; // Private to the module
     private int _number; // Same as "private module" since that's 
the default
}
```

Of course an equivalent to structs "private struct" could be 
added as well.


More information about the Digitalmars-d mailing list