Boost logo

Boost Users :

From: Gianni Luciani (gianni.luciani_at_[hidden])
Date: 2001-11-10 00:21:21


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net