Skip to content

Commit

Permalink
try making co_return strict
Browse files Browse the repository at this point in the history
  • Loading branch information
bashtanov committed Jan 3, 2025
1 parent f194d34 commit 5d479bf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions include/seastar/core/coroutine.hh
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ public:
promise_type(promise_type&&) = delete;
promise_type(const promise_type&) = delete;

template<typename... U>
void return_value(U&&... value) {
_promise.set_value(std::forward<U>(value)...);
template<typename U>
void return_value(U&& value) {
using From = decltype(std::forward<U>(value));
static_assert(std::is_convertible_v<From, T>, "only implicit conversions are considered");
_promise.set_value(std::forward<U>(value));
}

void return_value(coroutine::exception ce) noexcept {
Expand Down

0 comments on commit 5d479bf

Please sign in to comment.