diff --git a/include/dpp/coro/task.h b/include/dpp/coro/task.h index dbf639ab6f..d85dc13d06 100644 --- a/include/dpp/coro/task.h +++ b/include/dpp/coro/task.h @@ -261,7 +261,7 @@ struct task_promise_base { * Emulates the default behavior and sets is_sync to false if the awaited object is not ready. */ template - T await_transform(T&& expr) { + decltype(auto) await_transform(T&& expr) { if constexpr (requires { expr.operator co_await(); }) { auto awaiter = expr.operator co_await(); if (!awaiter.await_ready()) @@ -277,7 +277,7 @@ struct task_promise_base { else { if (!expr.await_ready()) is_sync = false; - return (expr); + return static_cast(expr); } }