Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2000-03-06 12:35:58


From: Dave Abrahams <abrahams_at_[hidden]>
> on 3/6/00 7:50 AM, Kevin Atkinson at kevinatk_at_[hidden] wrote:
>
> > Well pointers have an explicit conversion to bool.....
>
> Never mind my other post; I never checked ;)
> Anyway I'm against perpetuating the dangers of raw pointers where possible.
> If you want to write "if (!p)", how about a conversion to const void*?

And for all that, I still prefer that smart pointers have a conversion
to raw pointer. I like to be able to write generic code that doesn't
care what flavor of pointer it is dealing with, and you can't say p.get()
to a real pointer.

For the inverse reason, I worry about suggestions for creative uses of
operator new, for fear that they will compile with raw pointers but won't
mean the same thing.

For those who wish to banish raw pointers completely, I think that smart
pointers are not the right approach, except as an implementation
technique. I think the right approach is to encapsulate all heap
allocation and present users with classes that they need pass only by
value.


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