Thread overview | ||||||
---|---|---|---|---|---|---|
|
January 30, 2004 Re: "friends" | ||||
---|---|---|---|---|
| ||||
Posted in reply to der_held | der_held wrote:
> What about "friend" like in C++?
>
>
The docs say that you don't such! You have modules!
|
January 30, 2004 Re: "friends" | ||||
---|---|---|---|---|
| ||||
Posted in reply to der_held | 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. |
January 30, 2004 Re: "friends" | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vathix | 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
|
Copyright © 1999-2021 by the D Language Foundation