-
Notifications
You must be signed in to change notification settings - Fork 73
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
boost::mp11::mp_list can't be used as base class for transition table within msm::front::state_machine_def #63
Comments
While types derived from I also don't know why the MSM examples use inheritance. |
It seems that
while both fusion and mpl vectors are types referring to itself - in mp_list it could be something as:
thus it would be possible to define mpl adapters working also with types derived from type-list type. I also found in fusion-mpl adapters, that it is also required some inner-type for tag used in mpl adapters, in our example something like this:
I also tried at build-bench.com whether inheritance is somehow faster in compilation - and it is really faster but almost impossible to notice the difference, it is so small - see https://build-bench.com/b/kslOjZyqZVmCm6qrMEgf1ptanbM
|
Maybe the best solution to this problem would be to create The idea in short:
And just forward all mpl operations/algorithms to base mp_list
|
I just wanted to modernize my code - and try to use
boost::mp11::mp_list
instead ofboost::mpl::vector
in my FSM definitions.Simplified code is as follows:
It compiles, but produces unexpected output:
While - with original version (just replacing mp11::mp_list with mpl::vector) it works as expected:
It also works as expected with
boost::fusion::vector
.I found one workaround - when using type-alias for defining transition table it works as expected:
With type-alias it also works for other types boost::mpl::vector and boost::fustion::vector.
I am not sure what this inheritance is for, but all examples from boost::msm defines this transition tables that way.
The problem with
boost::mp11::mp_list
is probably here <boost/mp11/mpl.hpp> - but I am not sure that.I asked the question about that on SO: https://stackoverflow.com/questions/68195912/boostmp11mp-list-cant-define-proper-transition-table-for-fsm-based-on-boost - but not get much attention.
You can play with the problem on compiler explorer: https://godbolt.org/z/jTEnxPMTj
The problem is not related to version of boost or compiler.
The text was updated successfully, but these errors were encountered: