Lambdas are by deafult const so that they produce the same output every time they are run. This lambda needs to set the value on a captured promise which is a mutating operation, so it must be mutable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372336
91177308-0d34-0410-b5e6-
96231b3b80d8
auto FutureResult = Promise.get_future();
if (auto Err = this->template appendCallAsync<Func>(
- [Promise = std::move(Promise)](ErrorReturn RetOrErr) {
+ [Promise = std::move(Promise)](ErrorReturn RetOrErr) mutable {
Promise.set_value(std::move(RetOrErr));
return Error::success();
},