Open lewissbaker opened 6 months ago
Addressing this should be tackled as part of the same paper written for #42.
We have discussed this in an authors sync meeting.
We can update the stoppable-source concept and it's description later as part of the next revision/wording for P3409, which is going to be forced to deal with this.
It doesn't have any design/semantic implications as the concept isn't used outside of the general description of stop-tokens (there is no API usage of this concept), it is just a wording device/convenience.
I have been working on a new stoppable_token data-structure that has a single stop-source/stop-state but that can have N independent stop-tokens, each of which can have at most one stop-callback associated with it at a time.
For example: Something along the following lines.
The trouble is, this stop-source type has a
get_token<Idx>()
method to obtain a particular token, whereas thestoppable-source
concept currently requires aget_token()
member-function. Therefore this type would be unable to satisfy thestoppable-source
concept and so could not benefit from the generic wording there.Would it be possible to weaken the
stoppable-source
concept so that it does not specify how to get astoppable_token
from the stop-source, and just provided the other three methods? Then the relevant concrete types,std::stop_source
,std::inplace_stop_source
andstd::finite_inplace_stop_source<N>
could then specify independently how to obtain an "associated stoppable_token".