how to get typeid of extern(C++) classes?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Sat Feb 17 05:49:23 UTC 2018


On Saturday, February 17, 2018 00:23:01 Meta via Digitalmars-d wrote:
> On Friday, 16 February 2018 at 00:42:02 UTC, Timothee Cour wrote:
> > C++ exposes it via typeid so in theory all the info is there ;
>
> It's been awhile since I've written any C++ code, but as I
> remember it, this type of type info is not available unless you
> enable it with a (C++) compiler switch.

I think that all that's required is #including <typeinfo>. Certainly, I've
never used a compiler switch to get at it, but I have no clue what
<typeinfo> really does to make things work beyond making certain symbols
available. So, I don't know how easy it is to make it work from D code.

- Jonathan M Davis



More information about the Digitalmars-d mailing list