Getting module of a class

Sergey Gromov snake.scaly at gmail.com
Sat Oct 18 08:59:32 PDT 2008


Sat, 18 Oct 2008 05:58:50 +0900,
Bill Baxter wrote:
> The truly simplest solution here is just to ignore Scott Meyer's
> advice and make nonMemberFunction a static member function.  That way
> if I have access to SomeClass I will always have easy access to
> nonMemberFunction, regardless of whatever round-about chain of imports
> and aliases got me SomeClass.

To define a non-member, *non-friend* function in D you must define it in 
a different module than the module in which your class is defined.  Good-
bye encapsulation.  :)



More information about the Digitalmars-d mailing list