Extending D's support for object-oriented design with private(this)

NotYouAgain NotYouAgain at gmail.com
Fri Apr 26 06:39:31 UTC 2024


On Thursday, 25 April 2024 at 05:37:24 UTC, NotYouAgain wrote:
>

In anticipation of this new question (what happens it you use 
private(this) in global scope?

I can answer this below (in code):

module m;
@safe:

import std;

private(this) int x; // Error: visibility attribute 
`private(this)` cannot be used in global scope

void main(){}




More information about the dip.ideas mailing list