From 1d11ecfbcd4714c4d568ed1c44ee2df07dfba735 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 21 Sep 2014 19:52:04 +0300 Subject: [PATCH] future: implement move assignment --- core/future.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/future.hh b/core/future.hh index 07abfe9a3e..ce7cc99c71 100644 --- a/core/future.hh +++ b/core/future.hh @@ -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) {