From 5d479bf0c189eb030bc273c94a909d3708f16662 Mon Sep 17 00:00:00 2001 From: Alexey Bashtanov Date: Fri, 3 Jan 2025 11:17:10 +0000 Subject: [PATCH] try making co_return strict --- include/seastar/core/coroutine.hh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/seastar/core/coroutine.hh b/include/seastar/core/coroutine.hh index 4373db5cdc..ba8377a744 100644 --- a/include/seastar/core/coroutine.hh +++ b/include/seastar/core/coroutine.hh @@ -49,9 +49,11 @@ public: promise_type(promise_type&&) = delete; promise_type(const promise_type&) = delete; - template - void return_value(U&&... value) { - _promise.set_value(std::forward(value)...); + template + void return_value(U&& value) { + using From = decltype(std::forward(value)); + static_assert(std::is_convertible_v, "only implicit conversions are considered"); + _promise.set_value(std::forward(value)); } void return_value(coroutine::exception ce) noexcept {