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

Function undiscardable

include/process/future.hpp:1925–1936  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1923// or any of the futures returned from the invocations of `.then()`.
1924template <typename T>
1925Future<T> undiscardable(const Future<T>& future)
1926{
1927 std::unique_ptr<Promise<T>> promise(new Promise<T>());
1928 Future<T> future_ = promise->future();
1929 future.onAny(lambda::partial(
1930 [](std::unique_ptr<Promise<T>> promise, const Future<T>& future) {
1931 promise->associate(future);
1932 },
1933 std::move(promise),
1934 lambda::_1));
1935 return future_;
1936}
1937
1938
1939// Decorator that for some callable `f` invokes

Callers 3

stopMethod · 0.85
TESTFunction · 0.85
operator()Method · 0.85

Calls 2

futureMethod · 0.80
associateMethod · 0.80

Tested by 1

TESTFunction · 0.68