Boost logo

Boost :

From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2002-09-03 02:50:18


Björn Karlsson wrote:
> Given
>
> class A {};
> class B : public A {};
>
> you can do this,
>
> dynany da=new B;
> A* pa=any_cast<A*>(da);

Little correction:
  dynany da = B(); // not a 'new B'!
  A & ra = any_cast<A &>(da); // by reference, not pointer!

--
Best regards,
Alexander Nasonov
e-mail account: alnsn
e-mail server:  mail.ru

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