cppcoro icon indicating copy to clipboard operation
cppcoro copied to clipboard

Question on implementation of some concepts

Open Chlorie opened this issue 3 years ago • 0 comments

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?

Chlorie avatar Oct 03 '20 11:10 Chlorie