how to make private class member private

arturg var.spool.mail700 at gmail.com
Sat Mar 17 21:22:44 UTC 2018


On Saturday, 17 March 2018 at 14:16:19 UTC, bauss wrote:
> I don't like the name @deny, personally I would rather see the 
> private attribute changed to something like:
>
> private(true) // The member is oly visible to its parent.
>
> private(false) // Same as just "private", visible to whole 
> module.
>
> Could be specialized to something like:
>
> private(this) // Same as private(true)
>
> private(module) // Same as private(false)
>

maybe extend that to a list of types?

private(typeof(this), Foo, Bar)

would mean only typeof(this), Foo and Bar from the same module 
have access.


More information about the Digitalmars-d-learn mailing list