Boost logo

Boost :

From: Jesse Jones (jesjones_at_[hidden])
Date: 2002-01-14 07:51:37


At 2:00 AM -0800 1/13/02, Andrei Alexandrescu wrote:
> > This would not be a major issue for a rarely used function, but I have
>> found that I tend to make extensive use of 'boost::shared_ptr::get'.
>
>I'm not trying to make criticisms based on so little information here, but I
>guess a good design would not need to have access to the underlying raw
>pointer managed by a smart pointer. I guess operator-> should be heavily
>used.

I often use the get() method with boost's smart pointers to assert
that a pointer isn't NULL or occasionally to test that it isn't NULL
before using it. I find it pretty annoying to have to stick a method
call into a simple pointer test like this. Could we add something
like boost::function's safe_bool into the next rev of the smart
pointer classes?

   -- Jesse


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