You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it's sometimes useful to emulate dynamic casting in runtime having only TypeInfo_Class at hands. now one has to rely on undocumented (and unexported) `_d_dynamic_cast()` and friends, writing something like this:
// get druntime cast function
private extern(C) void*_d_dynamic_cast (Object o, ClassInfo c);
bool isCastable (Object O, TypeInfo_Class ti) {
return (_d_dynamic_cast(o, ti) !is null);
}
it would be fine to introduce and use a documented API for that, like this:
ti.dynamicCast(O)
ti.isBaseOf(O)
i.e. we should add these methods to TypeInfo_Class. also, the same methods should be added to TypeInfo_Interface.
The text was updated successfully, but these errors were encountered:
Ketmar Dark reported this on 2015-12-09T07:17:45Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=15427
CC List
Description
The text was updated successfully, but these errors were encountered: