Skip to content

Commit

Permalink
coro: add make_task
Browse files Browse the repository at this point in the history
  • Loading branch information
xlauko committed Feb 27, 2024
1 parent 628ca0f commit 0f222bf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions coro/include/gap/coro/task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,13 @@ namespace gap::coro
coroutine_handle m_coroutine = nullptr;
};

template< awaitable awaitable_t >
auto make_task(awaitable_t awaitable)
-> task< std::remove_reference_t< await_result_t< awaitable_t > > >
{
co_return co_await static_cast< awaitable_t&& >(awaitable);
}

namespace detail
{
template< typename T >
Expand Down

0 comments on commit 0f222bf

Please sign in to comment.