Boost logo

Boost Users :

From: Gianni Luciani (gianni.luciani_at_[hidden])
Date: 2001-11-08 20:07:55


Hi,

any is really a powerful class, but sometimes I would also be
able to know directly the type stored into it without 'guessing', for
example to use it in template code.
What I would like to have is something as

type_info::real_type for the value hidden into any (not legal C++, maybe
legal C++0x ?),

or, alternatively, virtual template functions (again not legal C++) to be
able to write generic
code depending on both hidden value's type and types 'from the outside
world' (sorry cannot explain it better :-( than this)

I have tried various approaches, but if I 'visit' the any class adding a
virtual function to reach hidden value I loose generic type information
(lack of virtual template functions) from the outside while from the
outside of any
I cannot obtain directly the type of the hidden value ...

is there a way to do the above ?

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