Allow for mutable lambdas with Future::ensure()
[folly.git] / folly / futures / Future-inl.h
index 0756fd34423f6e5a8e54ab1f3f978f4bb33884b4..d4614fce2e8bc50dd4098d364b57ef7984369250 100644 (file)
@@ -301,7 +301,7 @@ template <class T>
 template <class F>
 Future<T> Future<T>::ensure(F func) {
   MoveWrapper<F> funcw(std::move(func));
-  return this->then([funcw](Try<T>&& t) {
+  return this->then([funcw](Try<T>&& t) mutable {
     (*funcw)();
     return makeFuture(std::move(t));
   });