});
});
- return std::move(f);
+ return f;
}
// Variant: f.then([](T&& t){ return t; });
}
});
- return std::move(f);
+ return f;
}
// Variant: f.then([](){ return; });
}
});
- return std::move(f);
+ return f;
}
// Variant: f.then([](Try<T>&& t){ return makeFuture<T>(t.value()); });
}
});
- return std::move(f);
+ return f;
}
// Variant: f.then([](T&& t){ return makeFuture<T>(t); });
}
});
- return std::move(f);
+ return f;
}
// Variant: f.then([](){ return makeFuture(); });
}
});
- return std::move(f);
+ return f;
}
template <class T>
template <class T>
Future<typename std::decay<T>::type> makeFuture(T&& t) {
Promise<typename std::decay<T>::type> p;
- auto f = p.getFuture();
p.setValue(std::forward<T>(t));
- return std::move(f);
+ return p.getFuture();
}
inline // for multiple translation units
Future<void> makeFuture() {
Promise<void> p;
- auto f = p.getFuture();
p.setValue();
- return std::move(f);
+ return p.getFuture();
}
template <class F>
typename std::enable_if<!std::is_reference<F>::value, bool>::type sdf)
-> Future<decltype(func())> {
Promise<decltype(func())> p;
- auto f = p.getFuture();
p.fulfil(
[&func]() {
return (func)();
});
- return std::move(f);
+ return p.getFuture();
}
template <class F>
template <class T>
Future<T> makeFuture(std::exception_ptr const& e) {
Promise<T> p;
- auto f = p.getFuture();
p.setException(e);
- return std::move(f);
+ return p.getFuture();
}
template <class T>
Future<T>>::type
makeFuture(E const& e) {
Promise<T> p;
- auto f = p.getFuture();
p.setException(make_exception_wrapper<E>(e));
- return std::move(f);
+ return p.getFuture();
}
template <class T>
auto f_saved = ctx->p.getFuture();
detail::whenAllVariadicHelper(ctx,
std::forward<typename std::decay<Fs>::type>(fs)...);
- return std::move(f_saved);
+ return f_saved;
}
// when (iterator)
});
}
- return std::move(f_saved);
+ return f_saved;
}
template <class InputIterator>
});
}
- return std::move(f_saved);
+ return f_saved;
}
template <class InputIterator>