Boost logo

Boost :

From: Kevlin Henney (kevlin_at_[hidden])
Date: 2000-09-04 04:25:10


In message <002501c015dd$9ac91900$309a60cb_at_yogi>, Mark Rodgers
<mark.rodgers_at_[hidden]> writes
>Now for your next trick, can you make this work?
>
>struct Base { virtual ~Base() {} };
>struct Derived : Base {};
>
>Derived d;
>boost::any a(&d);
>Base *pb = boost::any_cast<Base*>(a);

As it stands, not w/o more reflection capabilities in the language, no
:->

It was not one of the original design aims of any to be able to support
that level of interpretation of content. This is more the territory that
Peter's ref<> covers as it is anchored (ie templated) in a known class.
____________________________________________________________

  Kevlin Henney phone: +44 117 942 2990
  Curbralan Ltd mobile: +44 7801 073 508
  kevlin_at_[hidden] fax: +44 870 052 2289
____________________________________________________________


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk