Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-08-14 12:05:15


From: "Beman Dawes" <bdawes_at_[hidden]>
>
> For years I've avoided implicit conversions to bool, which usually means
> adding "== 0" or "!= 0", but sometimes "? ... : ..."

There is one (important) context where the implicit conversion cannot be
avoided: declarations in conditions.

if(X * p = dynamic_cast<X*>(q)) {}
if(shared_ptr<X> p = shared_dynamic_cast<X>(q)) {}
if(shared_ptr<X> p = make_shared(wp)) {}


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