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>
|
template<typename R, typename ...A>
|
||||||
struct coroutine<R(A...)>: detail::coro_base<R, A...> {
|
struct coroutine<R(A...)>: detail::coro_base<R, A...> {
|
||||||
coroutine(
|
template<typename F>
|
||||||
std::function<R(coroutine<R(A...)> &, A...)> func,
|
coroutine(F func, size_t ss = COROUTINE_DEFAULT_STACK_SIZE):
|
||||||
size_t ss = COROUTINE_DEFAULT_STACK_SIZE
|
|
||||||
):
|
|
||||||
detail::coro_base<R, A...>(&context_call, ss), p_func(std::move(func))
|
detail::coro_base<R, A...>(&context_call, ss), p_func(std::move(func))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue