MCPcopy Create free account
hub / github.com/3rdparty/libprocess / execute

Method execute

include/process/executor.hpp:73–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 typename R = typename result_of<F()>::type,
72 typename std::enable_if<!std::is_void<R>::value, int>::type = 0>
73 auto execute(F&& f)
74 -> decltype(dispatch(process, std::function<R()>(std::forward<F>(f))))
75 {
76 // NOTE: Currently we cannot pass a mutable lambda into `dispatch()`
77 // because it would be captured by copy, so we convert `f` into a
78 // `std::function` to bypass this restriction.
79 return dispatch(process, std::function<R()>(std::forward<F>(f)));
80 }
81
82 // NOTE: This overload for `void` returns `Future<Nothing>` so we can
83 // chain. This follows the same behavior as `async()`.

Callers 1

TEST_FFunction · 0.45

Calls 2

bindFunction · 0.85
dispatchFunction · 0.70

Tested by 1

TEST_FFunction · 0.36