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-27 17:27:11 +02:00 committed by GitHub
parent b38dc28e01
commit 51371398ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -148,11 +148,13 @@ class Future {
consumed_or_moved_ = old.consumed_or_moved_;
old.consumed_or_moved_ = true;
}
Future &operator=(Future &&old) {
shared_ = std::move(old.shared_);
MG_ASSERT(!old.consumed_or_moved_, "Future moved from after already being moved from or consumed.");
shared_ = std::move(old.shared_);
old.consumed_or_moved_ = true;
}
Future(const Future &) = delete;
Future &operator=(const Future &) = delete;
~Future() = default;