Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-03-29 08:10:04


Larry Evans <cppljevans_at_[hidden]> writes:

> On 03/28/2006 05:45 PM, David Abrahams wrote:
>> I've developed some facilities that perhaps ought to be developed into
>> full-fledged libraries or components of existing Boost libraries.
>> This work centers around my long-standing threat to build a library
>> that could create smart pointers safely, without ever exposing a raw
>> pointer to the user. For example,
> [snip]
>> std::auto_ptr<foo> y(new_<foo>(*x, "hello, world", x));
>> boost::shared_ptr<foo> z(new_<foo>(*x, (char const*)"hello, world", x));
>
> My interpretation of "create smart pointers safely" is that there's no
> way the user can "accidentally" create a smart pointer which
> "originally" was a raw pointer. Since shared_ptr has a CTOR taking a
> raw pointer, this doesn't make shared_ptr "safe".

...

> Or maybe I'm misunderstanding your definition of "safe"?

Deliberately, it seems. I didn't say I was ``making shared_ptr
"safe".'' I said I was making it possible to create smart pointers
safely.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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