diff --git a/qcoro/task.h b/qcoro/task.h index a8932d08..ce4bcfb9 100644 --- a/qcoro/task.h +++ b/qcoro/task.h @@ -554,27 +554,27 @@ class Task { * returns an awaitable (Task) then the result of then is the awaitable. */ template - requires (std::invocable || (!std::is_void_v && std::invocable)) + requires (std::is_invocable_v || (!std::is_void_v && std::is_invocable_v)) auto then(ThenCallback &&callback) { return thenImpl(std::forward(callback)); } template - requires ((std::invocable || (!std::is_void_v && std::invocable)) && - std::invocable) + requires ((std::is_invocable_v || (!std::is_void_v && std::is_invocable_v)) && + std::is_invocable_v) auto then(ThenCallback &&callback, ErrorCallback &&errorCallback) { return thenImpl(std::forward(callback), std::forward(errorCallback)); } private: template - requires (std::invocable) + requires (std::is_invocable_v) auto invoke(ThenCallback &&callback, Args && ...) { return callback(); } template - requires (std::invocable) + requires (std::is_invocable_v) auto invoke(ThenCallback &&callback, Arg && arg) { return callback(std::forward(arg)); }