Boost logo

Boost Users :

Subject: Re: [Boost-users] [any] Is it possible to support polymorphism in boost::any?
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2010-09-06 12:10:56


On 06/09/10 16:49, Tang Jiang Jun wrote:
> I agree with you that void* just support polymorphism for single
> inheritance.
> However I think maybe it is possible to make boost::any to support full
> polymorphic behavior, because, for boost::any, there still has accurate
> type information when casting happens. With some tricks, maybe we can
> use dynamic_cast to help boost::any to cast the internal pointer to
> correct child class object.

I'd be surprised there is such a trick to do that.


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