Recommended practice: Implementations should use an intrusive queue of operation states
to hold the work units to make scheduling allocation-free
. namespace std::execution {
class run_loop {
class run-loop-scheduler;
class run-loop-sender;
struct run-loop-opstate-base {
virtual void execute() = 0;
run_loop* loop;
run-loop-opstate-base* next;
};
template<class Rcvr>
using run-loop-opstate = unspecified;
run-loop-opstate-base* pop-front();
void push-back(run-loop-opstate-base*);
public:
run_loop() noexcept;
run_loop(run_loop&&) = delete;
~run_loop();
run-loop-scheduler get_scheduler();
void run();
void finish();
};
}