Skip to content
New issue

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

Any state doesn't work correctly with nested sub-states #622

Open
dingari opened this issue Jun 21, 2024 · 0 comments
Open

Any state doesn't work correctly with nested sub-states #622

dingari opened this issue Jun 21, 2024 · 0 comments

Comments

@dingari
Copy link

dingari commented Jun 21, 2024

An FSM with a nested sub-state declared as a struct will not correctly transition using the any state feature (#602 )

I've been scratching my head for hours trying to figure out why my state machine doesn't behave the way I expect it to.

See this example.

I expect the state machine to transition from init -> b -> a -> b. This only happens if the nested state machine a itself is declared as a class.

Edit: Seems like it has something to the visibility of operator(). A struct with a private operator() transitions correctly, and a class with a public operator() doesn't...

@dingari dingari changed the title Any state doesn't work on struct substates Any state doesn't work correctly with nested sub-states Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant