Boost logo

Boost :

Subject: Re: [boost] [PATCH Boost.smart_ptr] Add intrusive_ptr<>::release()
From: Lars Viklund (zao_at_[hidden])
Date: 2013-12-02 10:37:56


On Mon, Dec 02, 2013 at 02:57:06PM +0200, Avi Kivity wrote:
> This provides a way to escape from automatic reference counting, and taking
> manual control of the reference. Useful when interfacing to a C API that
> expects a pointer with an elevated reference count.
>
> Similar to std::unique_ptr<>::release().

Running the risk of bikeshedding, the name could be a bit misleading to
some.

Examples:
CComPtr::Release reduces the refcount.
intrusive_ptr_release reduces the refcount.

For prior art, CComPtr uses 'Detach' to indicate disowning with retained
refcount, and symmetrically 'Attach' to acquiring reponsibility for a
pointer without adding refcount.

-- 
Lars Viklund | zao_at_[hidden]

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