Andrej Mitrovic:

> I've spotted this in QtD's codebase, dunno if this works:
> 
> T static_cast(T, U)(U obj)
> {
>     return cast(T)cast(void*)obj;
> }

See this thread, it contains a better implementation of staticCast (partially 
written by me), that I'd like in Phobos:
http://www.digitalmars.com/d/archives/digitalmars/D/learn/Dynamic_and_Static_Casting_24524.html

Bye,
bearophile

Reply via email to