libcoro  1.0
Coroutine support library for C++20

◆ requires()

template<typename T >
template<typename Arg0 , typename ... Args>
coro::shared_future< T >::requires ( !std::is_same_v< std::decay_t< Arg0 >, shared_future< T > >  ) &&

Construct shared future initialize it same way asi coro::future.

Parameters
arg0first argument. If the first argument is standard allocator (std::allocator) it uses allocator to allocate shared future instance. If the first argument is not allocator, the argument is passed as first argument to shared future instance directly
argsother arguments
Note
you can use all constructor types in same way as coro::future. If you need to convert coro::future to coro::shared_future, you need to pass a lambda function which returns coro::future
coro::shared_future<int> f([&]()->coro::future<int>{return calc_async();});
Contains future value of T, can be co_awaited in coroutine.
Definition: future.h:417
Future which can be shared (by copying - like shared_ptr)
Definition: future.h:1406