Boost logo

Boost :

From: Darin Adler (darin_at_[hidden])
Date: 1999-09-21 17:02:38


Valentin:
> I suggest the following implementation for new_polymorphic_downcast:
>
> template <class CastTo, class CastFrom>
> inline CastTo new_polymorphic_downcast(CastFrom* from)
> {
> assert(dynamic_cast<CastTo>(from) == from);
> return static_cast<CastTo>(from);
> }

This is even better. polymorphic_downcast<> should be changed to this.

    -- Darin


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