I\'ve stored a pointer to a type_info object.
type_info
int MyVariable = 123; const std::type_info* Datatype = &typeid(MyVariable);
Typecasting isn't a run-time process, it's a compile-time process at least for the type you're casting to. I don't think it can be done.