2 Dec
2013
2 Dec
'13
3:48 p.m.
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.