Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2003-09-13 07:05:36

"Thorsten Ottosen" <nesotto_at_[hidden]> wrote in message
> >From the documentation:
> >The C++ built-in dynamic_cast can be used for downcasts and crosscasts of
> pointers to polymorphic objects, but error notification in the form of a
> >returned value of 0 is inconvenient to test, or worse yet, easy to forget
> to test. The polymorphic_cast template performs a dynamic_cast, and throws
> an >exception if the dynamic_cast returns 0.
> what is the difference between this and
> dynamic_cast<Derived&>( *obj ) ?

get it, this is actually ill-formed code since we might dereference the
null-pointer. Maybe the documentation could
state this more explicitly?


Boost list run by bdawes at, gregod at, cpdaniel at, john at