D - "friend"-replacement?
- Norbert Nemec (6/6) Apr 25 2004 Hi there,
- J Anderson (4/9) Apr 25 2004 Modules.
- Norbert Nemec (5/11) Apr 25 2004 ???
- Ivan Senji (5/16) Apr 25 2004 any
- Scott Egan (5/16) Apr 25 2004 From memory private in a class is only private to the module.
- Norbert Nemec (3/4) Apr 25 2004 OK, the documentation can be understood like that, but it is not very
- J Anderson (11/15) Apr 25 2004 I'm not quite sure what you asking. When you use private in a module
Hi there, obviously, "friend" declarations from C++ do not exist in D. Is there any alternative way to implement a group of classes that interdepend on each other's internals without exposing these to the outside world? Thanks, Nobbi
Apr 25 2004
Norbert Nemec wrote:Hi there, obviously, "friend" declarations from C++ do not exist in D. Is there any alternative way to implement a group of classes that interdepend on each other's internals without exposing these to the outside world?Modules. -- -Anderson: http://badmama.com.au/~anderson/
Apr 25 2004
J Anderson wrote:Norbert Nemec wrote:??? As far as I understand, you can have classes and functions private to a module or class members private to the class, but how do you make class members private to the module?obviously, "friend" declarations from C++ do not exist in D. Is there any alternative way to implement a group of classes that interdepend on each other's internals without exposing these to the outside world?Modules.
Apr 25 2004
"Norbert Nemec" <Norbert.Nemec gmx.de> wrote in message news:c6g2ft$16na$1 digitaldaemon.com...J Anderson wrote:anyNorbert Nemec wrote:obviously, "friend" declarations from C++ do not exist in D. Is thereThis is not possible. One module should contain only classes that are friends.??? As far as I understand, you can have classes and functions private to a module or class members private to the class, but how do you make class members private to the module?alternative way to implement a group of classes that interdepend on each other's internals without exposing these to the outside world?Modules.
Apr 25 2004
From memory private in a class is only private to the module. See: http://www.digitalmars.com/d/attribute.html "Norbert Nemec" <Norbert.Nemec gmx.de> wrote in message news:c6g2ft$16na$1 digitaldaemon.com...J Anderson wrote:anyNorbert Nemec wrote:obviously, "friend" declarations from C++ do not exist in D. Is there??? As far as I understand, you can have classes and functions private to a module or class members private to the class, but how do you make class members private to the module?alternative way to implement a group of classes that interdepend on each other's internals without exposing these to the outside world?Modules.
Apr 25 2004
Scott Egan wrote:From memory private in a class is only private to the module.OK, the documentation can be understood like that, but it is not very concise in this point.
Apr 25 2004
Norbert Nemec wrote:As far as I understand, you can have classes and functions private to a module or class members private to the class, but how do you make class members private to the module?I'm not quite sure what you asking. When you use private in a module (whether it's within a class or not) it behaves on the module level. ie class A { private int x; } void main() { A a = new A; a.x = 10; //No error (if it was a different module there would be) } -- -Anderson: http://badmama.com.au/~anderson/
Apr 25 2004