On Thu, 8 Nov 2001, Douglas Gregor wrote:
On Thursday 08 November 2001 20:07, you wrote: [ SNIP ]
type_info::real_type for the value hidden into any (not legal C++, maybe legal C++0x ?), [ SNIP ] is there a way to do the above ?
Short answer: no.
Asking for the type given only a type_info object is asking a runtime entity (the object returned by typeid) to return a compile-time entity (a type). To make a scheme such as this work for all types (without enumerating them) would require all information about types to be resolved at compile time. At that point, static checking of types within C++ becomes impossible, and C++ starts to feel like Smalltalk <shutters>.
Hmm, then the other approach: are there ways to simulate virtual template functions ? Regards Gianni Luciani