Boost logo

Boost Users :

From: Stephan Diederich (stephan.diederich_at_[hidden])
Date: 2007-09-01 20:21:30


Hi Gernot,

On 9/1/07, Gernot Vormayr <gernot.vormayr_at_[hidden]> wrote:
>
> Hi!
>
> I have some problems using boost::any in different modules that get
> loaded with libdl. If i store an int in the boost::any it works like a
> charm - but when i use a std::string then the boost::any (holding a
> std::string) isn't any_castable to a std::string because it seems that
> typeid(std::string) != boost::any.type(). Only thing which is the same
> is the string represantation of type().name().

I've recently encountered this issue, too. The comparison failes because it
compares pointers and each module has its own static rtti information. You
could try http://lists.boost.org/Archives/boost/2007/07/124502.php for a
solution.

HTH,
Stephan



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