fix: add sml::deps<Ts...> policy for explicit pool deps (issue #437)#690
Merged
kris-jusiak merged 2 commits intoMay 28, 2026
Merged
Conversation
9cdfd4d to
8c300bb
Compare
PavelGuzenfeld
added a commit
to PavelGuzenfeld/sml
that referenced
this pull request
May 27, 2026
…t-ext#437) Covers the two scenarios from issue boost-ext#437: - Single dep accessed only via generic 4-arg lambda (sml::aux::get<Dep&>(deps)) - Multiple explicit deps, both accessed via generic lambdas Requires companion fix in sml.hpp (see PR boost-ext#690).
b2ee4b6 to
a5ed9ca
Compare
PavelGuzenfeld
added a commit
to PavelGuzenfeld/sml
that referenced
this pull request
May 27, 2026
…t-ext#437) Covers the two scenarios from issue boost-ext#437: - Single dep accessed only via generic 4-arg lambda (sml::aux::get<Dep&>(deps)) - Multiple explicit deps, both accessed via generic lambdas Requires companion fix in sml.hpp (see PR boost-ext#690).
cc95cff to
737253b
Compare
PavelGuzenfeld
added a commit
to PavelGuzenfeld/sml
that referenced
this pull request
May 27, 2026
…t-ext#437) Covers the two scenarios from issue boost-ext#437: - Single dep accessed only via generic 4-arg lambda (sml::aux::get<Dep&>(deps)) - Multiple explicit deps, both accessed via generic lambdas Requires companion fix in sml.hpp (see PR boost-ext#690).
737253b to
c89ce10
Compare
PavelGuzenfeld
added a commit
to PavelGuzenfeld/sml
that referenced
this pull request
May 27, 2026
…t-ext#437) Covers the two scenarios from issue boost-ext#437: - Single dep accessed only via generic 4-arg lambda (sml::aux::get<Dep&>(deps)) - Multiple explicit deps, both accessed via generic lambdas Requires companion fix in sml.hpp (see PR boost-ext#690).
c89ce10 to
47698ee
Compare
PavelGuzenfeld
added a commit
to PavelGuzenfeld/sml
that referenced
this pull request
May 27, 2026
…t-ext#437) Covers the two scenarios from issue boost-ext#437: - Single dep accessed only via generic 4-arg lambda (sml::aux::get<Dep&>(deps)) - Multiple explicit deps, both accessed via generic lambdas Requires companion fix in sml.hpp (see PR boost-ext#690).
…ext#437) When all actions/guards use generic 4-arg lambdas with sml::aux::get<Dep&>(deps) the dep type never appears in the auto-deduced dep_list, so pool<> never contains Dep and the static_cast from pool<> → pool_type<Dep&> fails to compile. Fix: introduce sml::deps<Ts...> SM policy that widens the pool to include explicitly named types regardless of whether any action/guard signature names them. Implementation: - back::policies::explicit_deps<Ts...> : aux::pair<explicit_deps_policy__, ...> - sm_policy::explicit_deps_policy picks it up via the existing get_policy mechanism - get_explicit_deps<P> helper converts the policy to type_list<Ts&...> with const-normalization (const T& → T&, same as ignore::non_events) - sm::deps_t joins explicit_dep_list ahead of the auto-deduced dep_list (unique_t deduplicates when both list a dep) - Public alias: template<class... Ts> using deps = back::policies::explicit_deps<Ts...> Usage: sml::sm<MyTable, sml::deps<MyDep>> sm{dep}; Verified: GCC C++17/C++20 (29/29 ft), MSVC C++20 (34/34) Companion test: see PR boost-ext#691
3dabcee to
76013e2
Compare
PavelGuzenfeld
added a commit
to PavelGuzenfeld/sml
that referenced
this pull request
May 27, 2026
…t-ext#437) Covers the two scenarios from issue boost-ext#437: - Single dep accessed only via generic 4-arg lambda (sml::aux::get<Dep&>(deps)) - Multiple explicit deps, both accessed via generic lambdas Requires companion fix in sml.hpp (see PR boost-ext#690).
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.
Problem
When all actions and guards use generic 4-arg lambdas to access deps manually:
…
MyDepnever appears in any explicitly-typed parameter list, sodep_list(computed viaget_deps_t→args_t) is empty. The pooldeps_tnever includesMyDep, and thestatic_castfrom the user-provided pool topool_type<MyDep&>fails to compile:Closes #437.
Fix
Introduce
sml::deps<Ts...>as a new SM policy that widens the deps pool to include explicitly named types:MyDep dep; sml::sm<MyTable, sml::deps<MyDep>> sm{dep};Implementation
back::policies::explicit_deps<Ts...>— new policy struct, follows sameaux::pair<Tag__, Self>pattern aslogger,thread_safe, etc.sm_policy::explicit_deps_policy— picked up via the existingget_policymechanism.get_explicit_deps<P>helper — convertsexplicit_deps<Ts...>→type_list<Ts&...>(with sameconst T&→T&normalization asignore::non_events);no_policy→ empty list.sm::deps_t— joinsexplicit_dep_listbefore the auto-deduceddep_list;unique_tdeduplicates when both list the same dep.template<class... Ts> using deps = back::policies::explicit_deps<Ts...>;The design is purely additive: existing SMs without the policy are unchanged.
Verified
Companion test PR: #691