|
Boost : |
From: Ed Brey (brey_at_[hidden])
Date: 2002-05-11 11:46:46
From: "Greg Colvin" <greg_at_[hidden]>
>
> >instead of: if (p) ...
> >write: if ( !! p ) ...
> >
> >Using this, of course, might be contrary to the user's religion :-) since
> >it looks akward to the unaware eye; but it can be handy to know about it.
>
> It's actually a minor tenet of my religion, and Max calls it the
> "boolean conversion operator". But then I prefer &*p to p->get()
> because it works with raw pointers as well as smart pointers.
The utility of &*p limited for either kind of pointer, however, since the expression yields defined behavior only if p is non-null.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk