}
template <class Func>
-auto via(Executor* x, Func func)
+auto via(Executor* x, Func&& func)
-> Future<typename isFuture<decltype(func())>::Inner>
{
// TODO make this actually more performant. :-P #7260175
- return via(x).then(std::move(func));
+ return via(x).then(std::forward<Func>(func));
}
template <class T>
/// This is semantically equivalent to via(executor).then(func), but
/// easier to read and slightly more efficient.
template <class Func>
-auto via(Executor*, Func func)
+auto via(Executor*, Func&& func)
-> Future<typename isFuture<decltype(func())>::Inner>;
/** When all the input Futures complete, the returned Future will complete.