Why do private member variables behaved like protected in the same module when creating deriving class?

Guillaume Piolat spam at smam.org
Mon Nov 5 13:59:31 UTC 2018


On Monday, 29 October 2018 at 10:32:00 UTC, Mike Parker wrote:
>
> I can't speak for others, but it's a feature I use fairly 
> often. I tend to design aggregates and free functions to the 
> module, as a cohesive whole, rather than as separate parts. If 
> I want separate parts, I put them in different modules and use 
> `package` for the bits that need to stay out of the public API. 
> Works a treat.

+1
I also see how it could be a problem in a team.
There is a tension between features for a team with "shared 
ownership of code" and features for individual developers.

Perhaps there is way to do a "Voldemort member", something that 
can't be named outside of the class.


More information about the Digitalmars-d mailing list