From 89f1e584145e72b892c1409b89cfae9b544405af Mon Sep 17 00:00:00 2001 From: Robert Leahy Date: Tue, 30 Dec 2025 19:41:21 -0500 Subject: [PATCH] stdexec::stoppable_token & ::stop_token_for_t: Support std::stop_token Both the stdexec::stoppable_token concept and the stdexec:: stop_token_for_t template type alias depend on the stop token type having a unary member template named callback_type. While P2300 added the aforementioned member template to std::stop_token that means that before C++26 the aforementioned utilities don't work therewith. Special cased: - stdexec::stoppable_token to allow std::stop_token without checking for the above-mentioned member template, and - stdexec::stop_token_t to resolve to std::stop_callback when its first template argument is std::stop_token --- include/stdexec/__detail/__stop_token.hpp | 20 +++++++-- test/CMakeLists.txt | 1 + .../concepts/test_concepts_stop_tokens.cpp | 43 +++++++++++++++++++ 3 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 test/stdexec/concepts/test_concepts_stop_tokens.cpp diff --git a/include/stdexec/__detail/__stop_token.hpp b/include/stdexec/__detail/__stop_token.hpp index e4df4fa41..d0bafa7fa 100644 --- a/include/stdexec/__detail/__stop_token.hpp +++ b/include/stdexec/__detail/__stop_token.hpp @@ -20,6 +20,8 @@ #include "__concepts.hpp" +#include + namespace stdexec { namespace __stok { template