ecor
Loading...
Searching...
No Matches
ecor::stoppable_token Concept Reference

Concept for stoppable tokens, requires that the type has stop_requested and stop_possible member functions that return bool, is copyable, equality comparable, and swappable. More...

#include <ecor.hpp>

Concept definition

template<class Token>
concept ecor::stoppable_token = requires( Token const tok ) {
{ tok.stop_requested() } noexcept -> std::same_as< bool >;
{ tok.stop_possible() } noexcept -> std::same_as< bool >;
{ Token( tok ) } noexcept;
} && std::copyable< Token > && std::equality_comparable< Token > && std::swappable< Token >
Concept for stoppable tokens, requires that the type has stop_requested and stop_possible member func...
Definition: ecor.hpp:1285

Detailed Description

Concept for stoppable tokens, requires that the type has stop_requested and stop_possible member functions that return bool, is copyable, equality comparable, and swappable.


Stop tokens provide an API for checking if a stop has been requested, and if stopping is possible. They are used in the environment to allow senders and receivers to cooperatively handle cancellation of asynchronous operations.