From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-08-30 14:35:39


On Thursday 29 August 2002 05:32 am, Alexander Nasonov wrote:
> So, this any is more flexible because dynamic_cast can be used to cast from
> placeholder to T even if T is not polymorphic:
> struct A {};
> struct B : A {};
> placeholder * p = new holder<B>(B());
> A * a = dynamic_cast<A *>(p);
> assert(a);

How does this affect the use of any (from a user's point-of-view)? While I'd
agree that this formulation is easier on the implementation side (although
potentially less efficient due to the use of multiple inheritance), I don't
see how it affects the interface to 'any'? Does it make 'any' more useful?

        Doug