Very hacky solution to class private members

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Thu Jun 9 10:26:31 UTC 2022


On Thursday, 9 June 2022 at 10:03:02 UTC, Dom Disc wrote:
> But what about all the member-functions of a class, that also 
> should not have access to some variables? (Because most of the 
> time, private members should only be accessed by a few members 
> that are designed to work with them). There neither private or 
> hidden on whatever level can help you.

I personally use underscore for member functions or class fields 
that has to be handled with care.

But if you look at the D standard library you see that some 
modules are convoluted and in such settings it would be better 
with another protection level.

In general if somebody wants to improve the language then they 
can find many of the problem spots in the D standard library and 
use that for making judgments.

If someone ever started on D3, that is the place to start IMO.



More information about the Digitalmars-d mailing list