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.
The trouble is, this stop-source type has a get_token<Idx>() method to obtain a particular token, whereas the stoppable-source concept currently requires a get_token() member-function. Therefore this type would be unable to satisfy the stoppable-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 a stoppable_token from the stop-source, and just provided the other three methods? Then the relevant concrete types, std::stop_source, std::inplace_stop_source and std::finite_inplace_stop_source<N> could then specify independently how to obtain an "associated stoppable_token".
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".