Add co_sm utility with coroutine policies, tests, and benchmark#10
Merged
gabewillen merged 2 commits intomainfrom Feb 24, 2026
Merged
Add co_sm utility with coroutine policies, tests, and benchmark#10gabewillen merged 2 commits intomainfrom
gabewillen merged 2 commits intomainfrom
Conversation
0083615 to
8467f41
Compare
There was a problem hiding this comment.
Pull request overview
Adds an opt-in coroutine-enabled state machine utility (co_sm) to Boost.SML, with configurable coroutine scheduler/allocator policies, plus functional tests and a benchmark target to validate and measure coroutine-enabled/disabled behavior.
Changes:
- Introduce
include/boost/sml/utility/co_sm.hppprovidingco_sm, coroutine scheduler policies, coroutine allocator policies, andbool_task. - Add functional tests for
co_sm(enabled/disabled paths) and add a regression test for issue boost-ext#171. - Add a new
benchmark/simple/co_sm.cpptarget and register it in CMake; small core mapping tweak ininclude/boost/sml.hppforanonymous.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
include/boost/sml/utility/co_sm.hpp |
New coroutine-enabled SM utility (co_sm), scheduler/allocator policies, and bool_task. |
include/boost/sml.hpp |
Extend event-mapping helper to handle anonymous. |
test/ft/co_sm.cpp |
New functional tests covering coroutine-enabled and disabled compilation paths. |
test/ft/issue_171.cpp |
New regression test ensuring wildcard event handling isn’t duplicated. |
test/ft/CMakeLists.txt |
Register new functional test executables (test_co_sm, test_issue_171). |
benchmark/simple/co_sm.cpp |
New benchmark comparing co_sm (when enabled) vs sm fallback. |
benchmark/simple/CMakeLists.txt |
Register the new simple_co_sm benchmark target. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
include/boost/sml/utility/co_sm.hppwithutility::co_sm,utility::bool_task, and coroutine scheduler/allocator policiestest/ft/co_sm.cppfor coroutine-enabled and disabled pathsbenchmark/simple/co_sm.cppand register it in CMakeQuality gates
Ran
./scripts/quality_gates.shsuccessfully:Notes
#include <boost/sml/utility/co_sm.hpp>include/boost/sml.hppBOOST_SML_UTILITY_CO_SM_ENABLED(C++20 + coroutine support)