From a3eb60c432c58a9dcf2c24af0082a4548c8b5698 Mon Sep 17 00:00:00 2001 From: Oliver Kowalke Date: Wed, 20 Dec 2017 06:21:48 +0000 Subject: [PATCH] Update pull_coroutine.hpp --- include/boost/coroutine2/detail/pull_coroutine.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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; }