Boost logo

Boost :

Subject: Re: [boost] [PATCH Boost.smart_ptr] Add intrusive_ptr<>::release()
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-12-02 10:48:42


On Monday 02 December 2013 16:37:56 Lars Viklund wrote:
> 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.

I'd vote to follow STL precedent rather than ATL.


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