We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
According to user guide, is<TState> should return true when any current state matches TState, false otherwise.
is<TState>
return true when any current state matches TState, false otherwise
However current implementation only checks the first of the orthogonal states
Following code (Based on orthogonal region example) should complete with no errors
#include <cassert> #include <https://raw.githubusercontent.com/boost-ext/sml/master/include/boost/sml.hpp> namespace sml = boost::sml; namespace { struct e1 {}; struct e2 {}; struct e3 {}; struct orthogonal_regions { auto operator()() const noexcept { using namespace sml; return make_transition_table( *"idle"_s + event<e1> = "s1"_s, "s1"_s + event<e2> = X , *"idle2"_s + event<e2> = "s2"_s, "s2"_s + event<e3> = X); } }; } // namespace int main() { sml::sm<orthogonal_regions> sm; using namespace sml; assert(sm.is("idle"_s, "idle2"_s)); sm.process_event(e1{}); assert(sm.is("s1"_s, "idle2"_s)); assert(sm.is("s1"_s)); // <-- Single state check assert(sm.is("idle2"_s)); // <-- Single state check sm.process_event(e2{}); assert(sm.is(X, "s2"_s)); sm.process_event(e3{}); assert(sm.is(X, X)); }
assert(sm.is("idle2"_s)); fails (assert(sm.is("s1"_s)); passes only because it is the first orthogonal state)
assert(sm.is("idle2"_s));
assert(sm.is("s1"_s));
Execute above code, available on compiler explorer: https://godbolt.org/z/MzWaqoh33
The text was updated successfully, but these errors were encountered:
No branches or pull requests
According to user guide,
is<TState>
shouldreturn true when any current state matches TState, false otherwise
.However current implementation only checks the first of the orthogonal states
Expected Behavior
Following code (Based on orthogonal region example) should complete with no errors
Actual Behavior
assert(sm.is("idle2"_s));
fails (assert(sm.is("s1"_s));
passes only because it is the first orthogonal state)Steps to Reproduce the Problem
Execute above code, available on compiler explorer: https://godbolt.org/z/MzWaqoh33
Specifications
The text was updated successfully, but these errors were encountered: