I was poking through the black magic in Casting.h, and I see this interesting struct/function:
template<class To, class FromTy> struct cast_convert_val<To,FromTy,FromTy> {
// This _is_ a simple type, just cast it.
static typename cast_retty<To, FromTy>::ret_type doit(const FromTy &Val) {
typename cast_retty<To, FromTy>::ret_type Res2
= (typename cast_retty<To, FromTy>::ret_type)const_cast<FromTy&>(Val);
return Res2;
}
};
Why is the C-style cast needed?