Update src/io/future.hpp

Co-authored-by: János Benjamin Antal <antaljanosbenjamin@users.noreply.github.com>
This commit is contained in:
Tyler Neely 2022-07-28 18:13:50 +02:00 committed by GitHub
parent 6bdfb43ad0
commit 8fde05444d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -206,13 +206,14 @@ class Promise {
Promise() = delete;
Promise(Promise &&old) {
shared_ = std::move(old.shared_);
MG_ASSERT(!old.filled_or_moved_, "Promise moved from after already being moved from or filled.");
shared_ = std::move(old.shared_);
old.filled_or_moved_ = true;
}
Promise &operator=(Promise &&old) {
shared_ = std::move(old.shared_);
MG_ASSERT(!old.filled_or_moved_, "Promise moved from after already being moved from or filled.");
shared_ = std::move(old.shared_);
old.filled_or_moved_ = true;
}
Promise(const Promise &) = delete;