forked from OctaForge/libostd
use generic arg so we can construct coroutines from lambdas using =
This commit is contained in:
parent
1bb2dffc63
commit
d369bb4b8a
|
@ -205,10 +205,8 @@ namespace detail {
|
|||
|
||||
template<typename R, typename ...A>
|
||||
struct coroutine<R(A...)>: detail::coro_base<R, A...> {
|
||||
coroutine(
|
||||
std::function<R(coroutine<R(A...)> &, A...)> func,
|
||||
size_t ss = COROUTINE_DEFAULT_STACK_SIZE
|
||||
):
|
||||
template<typename F>
|
||||
coroutine(F func, size_t ss = COROUTINE_DEFAULT_STACK_SIZE):
|
||||
detail::coro_base<R, A...>(&context_call, ss), p_func(std::move(func))
|
||||
{}
|
||||
|
||||
|
|
Loading…
Reference in a new issue