mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
IntrusivePtr: rename detach() to release()
Follow the C++ standard library conventions (here: `std::unique_ptr`).
This commit is contained in:
parent
edb93d1733
commit
08128b244f
11 changed files with 29 additions and 29 deletions
|
@ -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 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue