-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revamp blocking_kind calculation #524
Conversation
2701dde
to
8c34e5d
Compare
This diff promotes a *Sender's* "blocking kind" to a static property of the *Sender's* `sender_traits` named `blocking`, which replaces the `cblocking<Sender>()` function.
8c34e5d
to
78cdb39
Compare
@@ -350,6 +350,8 @@ class _sender<Source, Func>::type { | |||
static constexpr bool sends_done = | |||
sender_error_types_t<Source, sends_done_impl>::value; | |||
|
|||
// TODO: blocking and is_always_scheduler_affine; I don't have the brains to figure them out right now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be addressed in #528.
} | ||
friend constexpr blocking_kind tag_invoke(tag_t<unifex::blocking>, const type& sender) noexcept { | ||
// get the runtime blocking_kind for the predecessor | ||
blocking_kind pred = blocking(sender.pred_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be blocking_kind pred = unifex::blocking(sender.pred_);
. This also affects several other files. See also #555
Otherwise:
[build] C:\include\unifex/let_value.hpp(406): error C2064: term does not evaluate to a function taking 1 arguments
[build] C:\include\unifex/let_value.hpp(406): note: class does not define an 'operator()' or a user defined conversion operator to a pointer-to-function or reference-to-function that takes appropriate number of arguments
[build] C:\include\unifex/let_value.hpp(406): note: while trying to match the argument list '(const Predecessor)'
[build] with
[build] [
[build] Predecessor=unifex::_just::_sender<>::type
[build] ]
[build] C:\include\unifex/let_value.hpp(406): note: the template instantiation context (the oldest one first) is
[build] C:\main.cpp(5): note: while compiling class template member function 'unifex::_let_v::_sender<unifex::_just::_sender<>::type,a::<lambda_1>>::type unifex::_let_v::_cpo::_fn::operator ()<unifex::_just::_sender<>::type,a::<lambda_1>>(Predecessor &&,SuccessorFactory &&) noexcept const'
[build] with
[build] [
[build] Predecessor=unifex::_just::_sender<>::type,
[build] SuccessorFactory=a::<lambda_1>
[build] ]
[build] C:\include\unifex/let_value.hpp(419): note: see reference to variable template 'const bool is_nothrow_constructible_v<unifex::_let_v::_sender<unifex::_just::_sender<>::type,`a'::`2'::<lambda_1> >::type,unifex::_just::_sender<>::type,`a'::`2'::<lambda_1> >' being compiled
[build] C:\include\unifex/let_value.hpp(317): note: while compiling class 'unifex::_let_v::_sender<unifex::_just::_sender<>::type,a::<lambda_1>>::type'
[build] C:\include\unifex/let_value.hpp(404): note: while compiling class template member function 'unifex::_block::blocking_kind unifex::_let_v::tag_invoke(unifex::_block::_fn,const unifex::_let_v::_sender<unifex::_just::_sender<>::type,a::<lambda_1>>::type &) noexcept'
[build] C:\include\unifex/tag_invoke.hpp(34): note: see the first reference to 'unifex::_let_v::tag_invoke' in 'unifex::_tag_invoke::_fn::operator ()'
This diff promotes a Sender's "blocking kind" to a static property of the Sender's
sender_traits
namedblocking
, which replaces thecblocking<Sender>()
function.