diff --git a/include/boost/coroutine2/detail/push_coroutine.hpp b/include/boost/coroutine2/detail/push_coroutine.hpp index 4b183a7..45ae170 100644 --- a/include/boost/coroutine2/detail/push_coroutine.hpp +++ b/include/boost/coroutine2/detail/push_coroutine.hpp @@ -133,8 +133,7 @@ public: push_coroutine & operator=( push_coroutine && other) noexcept { if ( this == & other) return * this; - cb_ = other.cb_; - other.cb_ = nullptr; + std::swap(cb_, other.cb_); return * this; } @@ -211,8 +210,7 @@ public: push_coroutine & operator=( push_coroutine && other) noexcept { if ( this == & other) return * this; - cb_ = other.cb_; - other.cb_ = nullptr; + std::swap(cb_, other.cb_); return * this; }