YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
split.hpp
Go to the documentation of this file.
1#pragma once
2
6
7namespace yaclib {
8
9template <typename V, typename T>
11 static_assert(std::is_copy_constructible_v<wrap_void_t<V>>, "Cannot split this Result");
12 auto [f, p] = MakeSharedContract<V, T>();
13 Connect(std::move(future), std::move(p));
14 return std::move(f);
15}
16
17template <typename V, typename T>
22
23} // namespace yaclib
Provides a mechanism to access the result of async operations.
Definition future.hpp:20
detail::SharedCorePtr< V, T > & GetCore() noexcept
#define YACLIB_ASSERT(cond)
Definition log.hpp:85
Contract< V, T > MakeContract()
Creates related future and promise.
Definition contract.hpp:25
SharedFuture< V, T > Split(FutureBase< V, T > &&future)
Definition split.hpp:10
void Connect(FutureBase< V, T > &&f, Promise< V, T > &&p)
Definition connect.hpp:11