www.digitalmars.com         C & C++   DMDScript  

D - "friends"

reply der_held <der_held_member pathlink.com> writes:
What about "friend" like in C++?
Jan 30 2004
next sibling parent Stephan Wienczny <wienczny web.de> writes:
der_held wrote:
 What about "friend" like in C++?
 
 
The docs say that you don't such! You have modules!
Jan 30 2004
prev sibling parent reply Vathix <vathix dprogramming.com> writes:
der_held wrote:

 What about "friend" like in C++?
You can access private data within the same module. class Foo { private int bar; } void myfriend(Foo foo) { foo.bar = 1; //same module, so it's OK } I like this, however, I would assume in some situations you would need to do it from another module. I haven't needed to, yet.
Jan 30 2004
parent Lars Ivar Igesund <larsivar igesund.net> writes:
Vathix wrote:
 der_held wrote:
 
 I like this, however, I would assume in some situations you would need 
 to do it from another module. I haven't needed to, yet.
A sign of good design! Good job :) Lars Ivar Igesund
Jan 30 2004