mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
IntrusivePtr: overload std::swap()
This commit is contained in:
parent
4dbc224e21
commit
5ed69edb7e
1 changed files with 6 additions and 0 deletions
|
@ -118,6 +118,12 @@ public:
|
|||
std::swap(ptr_, other.ptr_);
|
||||
}
|
||||
|
||||
friend void swap(IntrusivePtr& a, IntrusivePtr &b) noexcept
|
||||
{
|
||||
using std::swap;
|
||||
swap(a.ptr_, b.ptr_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Detaches an object from the automated lifetime management and sets this
|
||||
* intrusive pointer to @c nullptr.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue