On Friday, 20 December 2013 at 14:55:46 UTC, Iain Buclaw wrote:
It should be possible if it's druntime handling all module loading (if
you circumvent the module load handlers, don't expect it to work
properly).

eg:

loadModule(mod);  // .ctors are ran and modules self register
themselves to 'mod'
mod.sortCtors();
mod.runSharedCtors();
// etc...

If you just load modules using druntime (or another helper function we control), then you can of course do the initialization like this.

You'd lose the benefit of seamlessly being able to load D libraries from e.g. C/C++ plugin hosts, though.

David

Reply via email to