A collection of DIPs

NX via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 8 23:48:44 PDT 2015


On Wednesday, 9 September 2015 at 06:13:59 UTC, Dominikus Dittes 
Scherkl wrote:
> On Tuesday, 8 September 2015 at 17:07:50 UTC, NX wrote:
>> And, can somebody show me a working example code of how to 
>> solve that friend class problem without some horrible hacktic 
>> way and agressive template/mixin stuff ? (I doubt it can 
>> solved via templates but anyway...)
> Why would you ever need "friend"?
> All functions have access to private members if they are 
> declared within the same module, so there "friend" is not 
> needed. And if you need access from outside the module, why do 
> you declare them "private"?
>
> IMHO "friend" is a misconception, that is only there to 
> compensate for the lack of modules in C++.

Woah! I didn't know about private members are visible in it's 
module, but to me it feels much cleaner if it was achieved by 
something similar to what I suggested... Isn't it?
never mind...


More information about the Digitalmars-d mailing list