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

master
Daniel Kolesa 2017-03-05 19:50:25 +01:00
parent 1bb2dffc63
commit d369bb4b8a
1 changed files with 2 additions and 4 deletions

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