Skip to content

Commit f9f3181

Browse files
committed
Feedback
Replace `_A` with `_Awaitable2` and use `__not_decay_to` as recommended.
1 parent 6271495 commit f9f3181

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

include/stdexec/__detail/__connect_awaitable.hpp

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,10 @@ namespace STDEXEC
215215
__state __awaiter_;
216216
};
217217

218-
template <class _A>
219-
requires(!std::same_as<std::remove_cvref_t<_A>, __awaitable_state>)
220-
explicit __awaitable_state(_A&& __awaitable)
221-
noexcept(__nothrow_constructible_from<_Awaitable, _A>)
222-
: __source_awaitable_(static_cast<_A&&>(__awaitable))
218+
template <__not_decays_to<__awaitable_state> _Awaitable2>
219+
explicit __awaitable_state(_Awaitable2&& __awaitable)
220+
noexcept(__nothrow_constructible_from<_Awaitable, _Awaitable2>)
221+
: __source_awaitable_(static_cast<_Awaitable2&&>(__awaitable))
223222
{}
224223

225224
~__awaitable_state() {}
@@ -288,11 +287,10 @@ namespace STDEXEC
288287
__state __awaiter_;
289288
};
290289

291-
template <class _A>
292-
requires(!std::same_as<std::remove_cvref_t<_A>, __awaitable_state>)
293-
explicit __awaitable_state(_A&& __awaitable)
294-
noexcept(__nothrow_constructible_from<_Awaitable, _A>)
295-
: __source_awaitable_(static_cast<_A&&>(__awaitable))
290+
template <__not_decays_to<__awaitable_state> _Awaitable2>
291+
explicit __awaitable_state(_Awaitable2&& __awaitable)
292+
noexcept(__nothrow_constructible_from<_Awaitable, _Awaitable2>)
293+
: __source_awaitable_(static_cast<_Awaitable2&&>(__awaitable))
296294
{}
297295

298296
~__awaitable_state() {}
@@ -360,11 +358,10 @@ namespace STDEXEC
360358
__state __awaiter_;
361359
};
362360

363-
template <class _A>
364-
requires(!std::same_as<std::remove_cvref_t<_A>, __awaitable_state>)
365-
explicit __awaitable_state(_A&& __awaitable)
366-
noexcept(__nothrow_constructible_from<_Awaitable, _A>)
367-
: __source_awaitable_(static_cast<_A&&>(__awaitable))
361+
template <__not_decays_to<__awaitable_state> _Awaitable2>
362+
explicit __awaitable_state(_Awaitable2&& __awaitable)
363+
noexcept(__nothrow_constructible_from<_Awaitable, _Awaitable2>)
364+
: __source_awaitable_(static_cast<_Awaitable2&&>(__awaitable))
368365
{}
369366

370367
~__awaitable_state() {}
@@ -392,11 +389,10 @@ namespace STDEXEC
392389
[[no_unique_address]]
393390
_Awaitable __awaiter_;
394391

395-
template <class _A>
396-
requires(!std::same_as<std::remove_cvref_t<_A>, __awaitable_state>)
397-
explicit __awaitable_state(_A&& __awaitable)
398-
noexcept(__nothrow_constructible_from<_Awaitable, _A>)
399-
: __awaiter_(static_cast<_A&&>(__awaitable))
392+
template <__not_decays_to<__awaitable_state> _Awaitable2>
393+
explicit __awaitable_state(_Awaitable2&& __awaitable)
394+
noexcept(__nothrow_constructible_from<_Awaitable, _Awaitable2>)
395+
: __awaiter_(static_cast<_Awaitable2&&>(__awaitable))
400396
{}
401397

402398
static constexpr void construct(__std::coroutine_handle<_Promise>) noexcept

0 commit comments

Comments
 (0)