Open phelter opened 3 months ago
I might be wrong here, but believe it's because std::bind performs type erasure which is required for the input event type? - Not quite sure why they both compile (using clang-17 ubuntu 22.04.4) but the lambda seg-faults and the bind does not.
With state machines I'd like to encapsulate the state machine within an object - after a bunch of investigation and trial and error with sml and sml2 found the following - works best: Something along the lines of this comment: https://github.com/boost-ext/sml/issues/311#issuecomment-548883956
The issue I have is when I try and use lambda's
eg:
The lambda's don't work since there is a difference in how the lambda captures
this
vs the std::bind capturesthis
. Both will compile but when using lambda's there's a seg-fault when it tries to call the action that is the lambda.Would be great if there's a compile-time check that a lambda isn't usable.
Also if concepts could be used to provide much easier to understand error identification when things like this are an issue. The amount of
cruff
in the compile warnings are problematic for static debugging of the issues related to the state machine.