The executor must be copied when an I/O object is move-assigned.

The moved-from I/O object needs to be left in the same state as if
constructed with a valid executor but without a resource.
This commit is contained in:
Christopher Kohlhoff 2021-03-03 18:50:31 +11:00
parent 845d8bfb3c
commit b5a8065ecc

View File

@ -96,8 +96,7 @@ public:
service_->move_assign(implementation_,
*other.service_, other.implementation_);
executor_.~executor_type();
new (&executor_) executor_type(
std::move(other.executor_));
new (&executor_) executor_type(other.executor_);
service_ = other.service_;
}
return *this;