cppcoro
cppcoro copied to clipboard
Question on implementation of some concepts
Is the DelayedScheduler
concept really implementable in C++20? The concept currently requires a DelayedScheduler
to receive any type of duration as its parameter, but AFAIK this kind of "for all" semantics is not implementable with C++20 concepts.
template <typename T>
concept delayed_scheduler = requires(T& sch, ??? dur) {
{ sch.schedule_after(dur) } -> awaitable;
};
duration auto
would be appropriate for the ???
(assuming the concept duration
exists), but it is not valid syntax.
If this is not doable, what else can I do to enforce similar constraints on the scheduler class?