On Friday, 18 May 2018 at 12:26:14 UTC, Gheorghe Gabriel wrote:
Good idea. Or: private(this)
Because using "this" it is easier tu put this code in a mixin for multiple classes.
Example:

string var = "private(this) var;";

class A {
    mixin(var);
}

class B {
    mixin(var);
}

Me like :)

You can have both so you can do what you say with private(this) and also allow access from other classes/structs

class A { private(this, B) onlyForMeAndTypeB; }

Essentially a more fine grained version of C++'s friend.

Reply via email to