Repository navigation
core(scheduler): enforce scheduler_concept per [exec.sched] - #2412
romintomasetti wants to merge 1 commit into
Conversation
deedc74 to
993e13a
Compare
| STATIC_REQUIRE(ex::scheduler<my_behavioral_scheduler>); | ||
| STATIC_REQUIRE(ex::sender<decltype(ex::schedule(my_behavioral_scheduler{}))>); |
There was a problem hiding this comment.
This now fails to compile.
@ericniebler I guess this defeats the principle of the explicit opt-in tag?
There was a problem hiding this comment.
See your comment #2256 (comment):
The scheduler concept requires the scheduler_concept nested alias. See [exec.sched]. I think the right fix here is for all of the schedulers in stdexec to provide that nested alias.
There was a problem hiding this comment.
I mean, it seems that my_behavioral_scheduler *should not model the scheduler concept (because it has the behavior of a scheduler, but not the scheduler_concept alias).
|
while agree with this PR in principle, it means that in practice some user-defined schedulers will suddenly stop satisfying the concept. i do not like breaking my users, at least not without some warning. my preference would be a deprecation warning for schedulers that fail to provide the nested alias. this could be achieved with a test in |
This is some sort of followup of NVIDIA#2256. Signed-off-by: romintomasetti <romin.tomasetti@gmail.com>
993e13a to
63f7a24
Compare
|
@ericniebler Sure! I just pushed a new version that does exactly that: provide 2 overloads of the |
Per
[exec.sched](I am not aware of a paper removing this requirement).In #2256, a test was added that ensures all
stdexecschedulers define the aliasscheduler_concept, and that it derives fromstdexec::scheduler_tag.But IMO anyone implementing their own schedulers must also comply to this rule.
This is some sort of followup of: