Class info on interfaces
Adam D. Ruppe via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Aug 26 11:59:23 PDT 2015
On Wednesday, 26 August 2015 at 18:53:19 UTC, Jacob Carlborg
wrote:
> Is that intentional? Perhaps because of COM and C++ interfaces?
Yes, exactly. COM and C++ things won't necessarily have a D
TypeInfo available and since interfaces can be them, it can't be
sure.
What I do there is to just cast the interface to Object. Then you
should check for null to cover those cases, then you can typeid
or classinfo it.
More information about the Digitalmars-d-learn
mailing list