Update pull_coroutine.hpp

This commit is contained in:
Oliver Kowalke 2017-12-20 06:21:48 +00:00 committed by GitHub
parent 7a702c4e86
commit a3eb60c432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,8 +167,7 @@ public:
pull_coroutine & operator=( pull_coroutine && other) noexcept { pull_coroutine & operator=( pull_coroutine && other) noexcept {
if ( this == & other) return * this; if ( this == & other) return * this;
cb_ = other.cb_; std::swap(cb_, other.cb_);
other.cb_ = nullptr;
return * this; return * this;
} }
@ -277,8 +276,7 @@ public:
pull_coroutine & operator=( pull_coroutine && other) noexcept { pull_coroutine & operator=( pull_coroutine && other) noexcept {
if ( this == & other) return * this; if ( this == & other) return * this;
cb_ = other.cb_; std::swap(cb_, other.cb_);
other.cb_ = nullptr;
return * this; return * this;
} }