Skip to content

Commit 5742a1f

Browse files
committed
Address just_from submit review
1 parent 9ec59c6 commit 5742a1f

2 files changed

Lines changed: 21 additions & 22 deletions

File tree

include/exec/just_from.hpp

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ namespace experimental::execution
3030

3131
namespace detail
3232
{
33-
auto _just_from(just_from_t*) -> STDEXEC::set_value_t;
34-
auto _just_from(just_error_from_t*) -> STDEXEC::set_error_t;
35-
auto _just_from(just_stopped_from_t*) -> STDEXEC::set_stopped_t;
33+
auto _just_from(just_from_t *) -> STDEXEC::set_value_t;
34+
auto _just_from(just_error_from_t *) -> STDEXEC::set_error_t;
35+
auto _just_from(just_stopped_from_t *) -> STDEXEC::set_stopped_t;
3636
} // namespace detail
3737

3838
template <class JustTag>
3939
struct _just_from
4040
{ // NOLINT(bugprone-crtp-constructor-accessibility)
4141
private:
4242
friend JustTag;
43-
using _set_tag_t = decltype(detail::_just_from(static_cast<JustTag*>(nullptr)));
43+
using _set_tag_t = decltype(detail::_just_from(static_cast<JustTag *>(nullptr)));
4444

4545
using _diag_t = STDEXEC::__if_c<STDEXEC_IS_SAME(_set_tag_t, STDEXEC::set_error_t),
4646
AN_ERROR_COMPLETION_MUST_HAVE_EXACTLY_ONE_ERROR_ARGUMENT,
@@ -54,11 +54,11 @@ namespace experimental::execution
5454
struct _probe_fn
5555
{
5656
template <class... Ts>
57-
auto operator()(Ts&&... ts) const noexcept -> _error_t<Ts...>;
57+
auto operator()(Ts &&...ts) const noexcept -> _error_t<Ts...>;
5858

5959
template <class... Ts>
6060
requires STDEXEC::__cmplsigs::__is_compl_sig<_set_tag_t(Ts...)>
61-
auto operator()(Ts&&...) const noexcept -> STDEXEC::completion_signatures<_set_tag_t(Ts...)>
61+
auto operator()(Ts &&...) const noexcept -> STDEXEC::completion_signatures<_set_tag_t(Ts...)>
6262
{
6363
return {};
6464
}
@@ -67,13 +67,13 @@ namespace experimental::execution
6767
template <class Rcvr>
6868
struct _complete_fn
6969
{
70-
Rcvr& _rcvr;
70+
Rcvr &_rcvr;
7171

7272
template <class... Ts>
7373
STDEXEC_ATTRIBUTE(always_inline, host, device)
74-
void operator()(Ts&&... ts) const noexcept
74+
void operator()(Ts &&...ts) const noexcept
7575
{
76-
_set_tag_t()(static_cast<Rcvr&&>(_rcvr), static_cast<Ts&&>(ts)...);
76+
_set_tag_t()(static_cast<Rcvr &&>(_rcvr), static_cast<Ts &&>(ts)...);
7777
}
7878
};
7979

@@ -89,17 +89,17 @@ namespace experimental::execution
8989
{
9090
if constexpr (STDEXEC::__nothrow_callable<Fn, _complete_fn<Rcvr>>)
9191
{
92-
static_cast<Fn&&>(_fn)(_complete_fn<Rcvr>{_rcvr});
92+
static_cast<Fn &&>(_fn)(_complete_fn<Rcvr>{_rcvr});
9393
}
9494
else
9595
{
9696
STDEXEC_TRY
9797
{
98-
static_cast<Fn&&>(_fn)(_complete_fn<Rcvr>{_rcvr});
98+
static_cast<Fn &&>(_fn)(_complete_fn<Rcvr>{_rcvr});
9999
}
100100
STDEXEC_CATCH_ALL
101101
{
102-
STDEXEC::set_error(static_cast<Rcvr&&>(_rcvr), std::current_exception());
102+
STDEXEC::set_error(static_cast<Rcvr &&>(_rcvr), std::current_exception());
103103
}
104104
}
105105
}
@@ -149,15 +149,15 @@ namespace experimental::execution
149149
auto connect(Rcvr rcvr) && noexcept(STDEXEC::__nothrow_decay_copyable<Rcvr, Fn>)
150150
-> _opstate<Rcvr, Fn>
151151
{
152-
return _opstate<Rcvr, Fn>{static_cast<Rcvr&&>(rcvr), static_cast<Fn&&>(_fn)};
152+
return _opstate<Rcvr, Fn>{static_cast<Rcvr &&>(rcvr), static_cast<Fn &&>(_fn)};
153153
}
154154

155155
template <class Rcvr>
156156
STDEXEC_ATTRIBUTE(host, device)
157157
auto connect(Rcvr rcvr) const & noexcept(STDEXEC::__nothrow_decay_copyable<Rcvr, Fn const &>)
158158
-> _opstate<Rcvr, Fn>
159159
{
160-
return _opstate<Rcvr, Fn>{static_cast<Rcvr&&>(rcvr), _fn};
160+
return _opstate<Rcvr, Fn>{static_cast<Rcvr &&>(rcvr), _fn};
161161
}
162162

163163
[[nodiscard]]
@@ -172,18 +172,17 @@ namespace experimental::execution
172172

173173
template <class Rcvr>
174174
STDEXEC_ATTRIBUTE(host, device)
175-
auto submit(Rcvr rcvr) && noexcept(STDEXEC::__nothrow_decay_copyable<Rcvr, Fn>) -> void
175+
auto submit(Rcvr rcvr) && noexcept(STDEXEC::__nothrow_decay_copyable<Fn>) -> void
176176
{
177-
auto op = static_cast<_sndr_base&&>(*this).connect(static_cast<Rcvr&&>(rcvr));
177+
auto op = static_cast<_sndr_base &&>(*this).connect(static_cast<Rcvr &&>(rcvr));
178178
STDEXEC::start(op);
179179
}
180180

181181
template <class Rcvr>
182182
STDEXEC_ATTRIBUTE(host, device)
183-
auto submit(Rcvr rcvr) const & noexcept(STDEXEC::__nothrow_decay_copyable<Rcvr, Fn const &>)
184-
-> void
183+
auto submit(Rcvr rcvr) const & noexcept(STDEXEC::__nothrow_decay_copyable<Fn const &>) -> void
185184
{
186-
auto op = this->connect(static_cast<Rcvr&&>(rcvr));
185+
auto op = this->connect(static_cast<Rcvr &&>(rcvr));
187186
STDEXEC::start(op);
188187
}
189188
};
@@ -204,7 +203,7 @@ namespace experimental::execution
204203
"must return an instance of a specialization of " STDEXEC_PP_STRINGIZE(
205204
STDEXEC) "::completion_signatures<>.");
206205
return _sndr<Fn>{
207-
{{}, static_cast<Fn&&>(fn)}
206+
{{}, static_cast<Fn &&>(fn)}
208207
};
209208
}
210209
else

test/exec/test_just_from.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace
3131
: should_throw_(&should_throw)
3232
{}
3333

34-
throwing_move_callable(throwing_move_callable const &other) noexcept
34+
throwing_move_callable(throwing_move_callable const & other) noexcept
3535
: should_throw_(other.should_throw_)
3636
{}
3737

@@ -163,7 +163,7 @@ namespace
163163
global_int = 42;
164164
auto s = exec::just_from([](auto sink) noexcept { return sink(global_int); })
165165
| ex::then(
166-
[](int &i) noexcept
166+
[](int& i) noexcept
167167
{
168168
CHECK(&i == &global_int);
169169
return std::ref(i);

0 commit comments

Comments
 (0)