IntrusivePtr: rename detach() to release()

Follow the C++ standard library conventions (here: `std::unique_ptr`).
This commit is contained in:
Max Kellermann 2020-02-19 05:37:34 +01:00
parent edb93d1733
commit 08128b244f
11 changed files with 29 additions and 29 deletions

View file

@ -63,7 +63,7 @@ public:
setPtr(raw_ptr, add_ref);
}
IntrusivePtr(IntrusivePtr&& other) noexcept : ptr_(other.detach())
IntrusivePtr(IntrusivePtr&& other) noexcept : ptr_(other.release())
{
// nop
}
@ -74,7 +74,7 @@ public:
}
template <class U, class = std::enable_if_t<std::is_convertible_v<U*, T*>>>
IntrusivePtr(IntrusivePtr<U> other) noexcept : ptr_(other.detach())
IntrusivePtr(IntrusivePtr<U> other) noexcept : ptr_(other.release())
{
// nop
}
@ -95,7 +95,7 @@ public:
* intrusive pointer to @c nullptr.
* @returns the raw pointer without modifying the reference count.
*/
pointer detach() noexcept
pointer release() noexcept
{
auto result = ptr_;
if ( result )