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