use generic arg so we can construct coroutines from lambdas using =

This commit is contained in:
q66 2017-03-05 19:50:25 +01:00
parent 1bb2dffc63
commit d369bb4b8a

View file

@ -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))
{} {}