Merge pull request #371 from gummif/gfa/move-ctors

Problem: Move assigned objects still alive
This commit is contained in:
Simon Giesecke 2019-12-07 10:59:18 +01:00 committed by GitHub
commit 0f8601c9eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -644,6 +644,7 @@ class context_t
context_t(context_t &&rhs) ZMQ_NOTHROW : ptr(rhs.ptr) { rhs.ptr = ZMQ_NULLPTR; }
context_t &operator=(context_t &&rhs) ZMQ_NOTHROW
{
close();
std::swap(ptr, rhs.ptr);
return *this;
}
@ -1566,6 +1567,7 @@ class socket_t : public detail::socket_base
}
socket_t &operator=(socket_t &&rhs) ZMQ_NOTHROW
{
close();
std::swap(_handle, rhs._handle);
return *this;
}