Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2000-03-19 18:48:55


At 01:37 AM 3/19/00 -0800, Nathan Myers wrote:

>Indeed, some of us argued for naming them member of auto_ptr<> that
>reveals the raw pointer value "auto_ptr<>::leak()". To me it seems
>a grave, grave design error to provide an automatic conversion for
>that purpose. Automatic conversions are dangerous enough in general,
>but when they contradict the base purpose of the component, it makes
>me wonder why somebody wants such a component at all.

Because it hides details. Because it makes code more readable.
Secondarily, because it makes smart pointers behave more like real pointers.

It is an issue of writing code for compilers versus writing code for human
readers.

Nathan, you have been a real leader when it comes to teaching people to
avoid harmful implicit conversions, but it seems to me this is a grey case
when the advantages may balance out the disadvantages.

--Beman


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