diff --git a/include/boost/coroutine2/detail/pull_coroutine.hpp b/include/boost/coroutine2/detail/pull_coroutine.hpp index ab90b60..823ca64 100644 --- a/include/boost/coroutine2/detail/pull_coroutine.hpp +++ b/include/boost/coroutine2/detail/pull_coroutine.hpp @@ -167,8 +167,7 @@ public: pull_coroutine & operator=( pull_coroutine && other) noexcept { if ( this == & other) return * this; - cb_ = other.cb_; - other.cb_ = nullptr; + std::swap(cb_, other.cb_); return * this; } @@ -277,8 +276,7 @@ public: pull_coroutine & operator=( pull_coroutine && other) noexcept { if ( this == & other) return * this; - cb_ = other.cb_; - other.cb_ = nullptr; + std::swap(cb_, other.cb_); return * this; }