Finding class template instantiations via runtime reflection (for openmethods)

Jacob Carlborg doob at me.com
Mon Sep 25 14:17:13 UTC 2017


On 2017-09-21 22:32, Jean-Louis Leroy wrote:
> It did not take long! Someone tried to create templatized open methods 
> and it didn't work right of the box. I expected that, but in fact there 
> may be a bit of hope. You cannot have virtual function templates in C++ 
> or in D because the layout of the vtables have to be known at compile 
> time - but openmethods creates its method tables at runtime so maybe it 
> can be made to work.
> 
> I stumbled upon a problem very quickly: it seems that classes that come 
> from class template instantiations are not registered in ModuleInfo - 
> see below,
> 
> Ideas?

Not sure exactly what you need get access to. But you could try to 
inspect the symbol table at runtime, if what you need is available there.

Of course, that's a bit of a PITA, but you would not be dependent on any 
bugs getting fixed or new features/improvements implemented.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list