future: implement move assignment

This commit is contained in:
Avi Kivity
2014-09-21 19:52:04 +03:00
parent 64ce457053
commit 1d11ecfbcd

View File

@@ -270,7 +270,13 @@ public:
}
}
future(const future&) = delete;
future& operator=(future&& x);
future& operator=(future&& x) {
if (this != &x) {
this->~future();
new (this) future(std::move(x));
}
return *this;
}
void operator=(const future&) = delete;
~future() {
if (_promise) {