Static cast

BCS ao at pathlink.com
Wed Jun 25 14:55:25 PDT 2008


Reply to Jason,

> What is the proper way to implement static cast?
> 
> cast(T) to shift with an object/ interface hierarchy is dynamic and
> slow. My problem is that cast(T)cast(void*) does not honor vtable
> locations and ClassInfo is only available at runtime.
> 

up cast or down cast?

IIRC upcast /is/ non-dynamic and skipping the test on downcast is just a 
bad idea.

Or am I not reading you correctly?




More information about the Digitalmars-d-learn mailing list