Skip to content

Commit 4f59b3c

Browse files
committed
Code review feedback
* `s/try/STDEXEC_TRY/g` * `s/catch (...)/STDEXEC_CATCH_ALL/g` * `s/__coro/&_/g`
1 parent 9421cd5 commit 4f59b3c

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

include/stdexec/__detail/__connect_awaitable.hpp

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ namespace STDEXEC
8484
template <class _Promise>
8585
static constexpr void await_suspend(__std::coroutine_handle<_Promise> __h) noexcept
8686
{
87-
try
87+
STDEXEC_TRY
8888
{
8989
__h.promise().__opstate_.__on_resume();
9090
}
91-
catch (...)
91+
STDEXEC_CATCH_ALL
9292
{
9393
__std::unreachable();
9494
}
@@ -137,11 +137,11 @@ namespace STDEXEC
137137

138138
constexpr auto get_return_object() noexcept -> __std::coroutine_handle<__promise>
139139
{
140-
try
140+
STDEXEC_TRY
141141
{
142142
return __std::coroutine_handle<__promise>::from_promise(*this);
143143
}
144-
catch (...)
144+
STDEXEC_CATCH_ALL
145145
{
146146
__std::unreachable();
147147
}
@@ -213,30 +213,31 @@ namespace STDEXEC
213213
constexpr explicit __opstate(_Awaitable&& __awaitable, _Receiver&& __rcvr)
214214
noexcept(__is_nothrow)
215215
: __rcvr_(static_cast<_Receiver&&>(__rcvr))
216-
, __coro(__co_impl(*this))
216+
, __coro_(__co_impl(*this))
217217
, __awaitable1_(static_cast<_Awaitable&&>(__awaitable))
218-
, __awaitable2_(__get_awaitable(static_cast<_Awaitable&&>(__awaitable1_), __coro.promise()))
218+
, __awaitable2_(
219+
__get_awaitable(static_cast<_Awaitable&&>(__awaitable1_), __coro_.promise()))
219220
, __awaiter_(__get_awaiter(static_cast<__awaitable_t&&>(__awaitable2_)))
220221
{}
221222

222223
void start() & noexcept
223224
{
224-
try
225+
STDEXEC_TRY
225226
{
226227
if (!__awaiter_.await_ready())
227228
{
228-
using __suspend_result_t = decltype(__awaiter_.await_suspend(__coro));
229+
using __suspend_result_t = decltype(__awaiter_.await_suspend(__coro_));
229230

230231
// suspended
231232
if constexpr (std::is_void_v<__suspend_result_t>)
232233
{
233234
// void-returning await_suspend means "always suspend"
234-
__awaiter_.await_suspend(__coro);
235+
__awaiter_.await_suspend(__coro_);
235236
return;
236237
}
237238
else if constexpr (std::same_as<bool, __suspend_result_t>)
238239
{
239-
if (__awaiter_.await_suspend(__coro))
240+
if (__awaiter_.await_suspend(__coro_))
240241
{
241242
// returning true from a bool-returning await_suspend means suspend
242243
return;
@@ -249,7 +250,7 @@ namespace STDEXEC
249250
else
250251
{
251252
static_assert(__std::convertible_to<__suspend_result_t, __std::coroutine_handle<>>);
252-
auto __resume_target = __awaiter_.await_suspend(__coro);
253+
auto __resume_target = __awaiter_.await_suspend(__coro_);
253254
__resume_target.resume();
254255
return;
255256
}
@@ -258,10 +259,10 @@ namespace STDEXEC
258259
// immediate resumption
259260
__on_resume();
260261
}
261-
catch (...)
262+
STDEXEC_CATCH_ALL
262263
{
263264
if constexpr (!noexcept(__awaiter_.await_ready())
264-
|| !noexcept(__awaiter_.await_suspend(__coro)))
265+
|| !noexcept(__awaiter_.await_suspend(__coro_)))
265266
{
266267
STDEXEC::set_error(static_cast<_Receiver&&>(__rcvr_), std::current_exception());
267268
}
@@ -287,7 +288,7 @@ namespace STDEXEC
287288

288289
constexpr void __on_resume() noexcept
289290
{
290-
try
291+
STDEXEC_TRY
291292
{
292293
if constexpr (std::is_void_v<decltype(__awaiter_.await_resume())>)
293294
{
@@ -299,7 +300,7 @@ namespace STDEXEC
299300
STDEXEC::set_value(static_cast<_Receiver&&>(__rcvr_), __awaiter_.await_resume());
300301
}
301302
}
302-
catch (...)
303+
STDEXEC_CATCH_ALL
303304
{
304305
if constexpr (!noexcept(__awaiter_.await_resume()))
305306
{
@@ -315,7 +316,7 @@ namespace STDEXEC
315316

316317
alignas(__storage_align) std::byte __storage_[__storage_size];
317318
_Receiver __rcvr_;
318-
__std::coroutine_handle<__promise_t> __coro;
319+
__std::coroutine_handle<__promise_t> __coro_;
319320
_Awaitable __awaitable1_;
320321
__awaitable_t __awaitable2_;
321322
__awaiter_t __awaiter_;

0 commit comments

Comments
 (0)