From 95f800d022dc0c5ce3a47595235e3e9b58d67b7a Mon Sep 17 00:00:00 2001 From: kwy404 Date: Sat, 26 Sep 2026 00:30:50 -0300 Subject: [PATCH] add missing `inplace_stop_callback::callback_type` [stopcallback.inplace.general] declares `using callback_type = CallbackFn;` as a public member of `inplace_stop_callback`. stdexec did not provide it, so `inplace_stop_callback::callback_type` failed to compile. Add the alias and a test. --- include/stdexec/stop_token.hpp | 2 ++ test/stdexec/concepts/test_concepts_stop_tokens.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/include/stdexec/stop_token.hpp b/include/stdexec/stop_token.hpp index def63b446..c4ecc5aab 100644 --- a/include/stdexec/stop_token.hpp +++ b/include/stdexec/stop_token.hpp @@ -232,6 +232,8 @@ STDEXEC_P2300_NAMESPACE_BEGIN() class inplace_stop_callback : STDEXEC::__stok::__inplace_stop_callback_base { public: + using callback_type = _Fun; + template requires STDEXEC::__std::constructible_from<_Fun, _Fun2> explicit inplace_stop_callback(inplace_stop_token __token, _Fun2&& __fun) diff --git a/test/stdexec/concepts/test_concepts_stop_tokens.cpp b/test/stdexec/concepts/test_concepts_stop_tokens.cpp index 203b6a7bc..1c14ad82d 100644 --- a/test/stdexec/concepts/test_concepts_stop_tokens.cpp +++ b/test/stdexec/concepts/test_concepts_stop_tokens.cpp @@ -33,6 +33,12 @@ namespace void operator()() && noexcept {} }; + TEST_CASE("inplace_stop_callback exposes its callback type", "[stop_token]") + { + STATIC_REQUIRE(std::is_same_v<::STDEXEC::inplace_stop_callback::callback_type, + on_stop_request>); + } + TEST_CASE("(un)stoppable_token correctly categorizes various standard stop token types", "[concepts]") {