Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-08-30 13:50:11


AMDG

joel falcou wrote:
> Let's say i have a hierarchy of object that all inherits from a abse class
> called base_impl.
> Among those classes, most of them are tempalte that
> have large, complex type.
>
> My idea was to use boost::any to
> store any of this classes' instances, any_cast them back to base_impl* and
> call one of the base_impl virtual method.
>

Why can't you return shared_ptr<base_impl*>, e.g.?

> I can't
> rely on stroing a pointer in the boost::any member.
> Any solution to
> this problem or am I doing something wrong.
>

boost::any_cast requires the type to match exactly.

In Christ,
Steven Watanabe


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