| 177 | |
| 178 | template <typename F> |
| 179 | Future<typename result_of<F()>::type> execute( |
| 180 | const F& f, |
| 181 | typename std::enable_if<!std::is_void<typename result_of<F()>::type>::value>::type* = nullptr) // NOLINT(whitespace/line_length) |
| 182 | { |
| 183 | // Need to disambiguate overloaded method. |
| 184 | typename result_of<F()>::type(AsyncExecutorProcess::*method)(const F&) = |
| 185 | &AsyncExecutorProcess::execute<F>; |
| 186 | |
| 187 | return dispatch(process, method, f); |
| 188 | } |
| 189 | |
| 190 | template <typename F> |
| 191 | Future<Nothing> execute( |