package & protected?

Kagamin spam at here.lot
Wed Oct 23 16:31:14 UTC 2024


Another option is an accessor class:
```
class A
{
	protected int b;
	package class Accessor
	{
		int b(){ return this.outer.b; }
	}
}

void f1()
{
	A a=new A;
	a.b=2;
	auto aa=a.new Accessor;
	assert(aa.b==2);
}
```


More information about the Digitalmars-d mailing list