Object.factory

Sean Kelly sean at f4.ca
Wed Sep 26 09:01:06 PDT 2007


DanO wrote:
> Sean Kelly Wrote:
> 
> 
>> You will need to generate the code for any template you want to generate 
>> via Object.factory by aliasing or instantiating it at compile-time. 
>> Otherwise, the code won't even exist in your app.  This should do the trick:
>>
>> alias MyDict!(int) GenerateMyDict_int;
> 
> Just so everyone knows, all of the templates I am trying to dynamically create are declared and instantiated in the same module where they are defined, and all of the ones I am trying to instantiate are used somewhere in the module, usually as members of other classes.  I have tried every conceivable permutation of things to get it to work, but it just looks like those classes are not in the ModuleInfo.  Probably a compiler issue.

Sounds like it.  It would be nice if the compiler at least registered 
templates declared in the same module they are defined.


Sean



More information about the Digitalmars-d mailing list