Well, if you have unions you could probably do casts in a library. I'm not saying we should do this, just that it's possible. For example:U cast(T)(T ptr) if(isPointer!T && isPointer!U) { union U { T t; U u; } U myUnion; myUnion.t = ptr; return myUnion.u; }
It's a good point, but that's only for certain cases of reinterpret cast. Object casts and in particular interface-to-Object and other cross-casts won't work that way.
Andrei _______________________________________________ phobos mailing list [email protected] http://lists.puremagic.com/mailman/listinfo/phobos
