class creation in module scope?

Derek Parnell derek at nomail.afraid.org
Wed Mar 21 16:01:32 PDT 2007


On Wed, 21 Mar 2007 14:06:16 -0800, BCS wrote:

> Use a static constrctor ...

Also known as a Module constructor so as not to be confused with a class
constructors (at least in my mind).

Module constructors are executed at run time before main() gets control. If
you have import multiple modules with module constructors, they are
executed in the order of the import statements. 

Beware of dependencies between modules as this can cause DMD to fail if
recursive modules contain constructors.
 
-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Justice for David Hicks!"
22/03/2007 9:54:54 AM


More information about the Digitalmars-d-learn mailing list