Closed redboltz closed 6 years ago
I'd like to use a class that inherits state_machine_def and contains move only type member variables as follows:
#include <boost/msm/back/state_machine.hpp> #include <boost/msm/front/state_machine_def.hpp> namespace msm = boost::msm; struct foo { foo() = default; foo(foo const&) = delete; foo(foo&&) = default; }; // ----- State machine struct Sm1_:msm::front::state_machine_def<Sm1_> { struct State1:msm::front::state<> {}; typedef State1 initial_state; Sm1_(foo&& val):val(std::move(val)) {} foo val; }; typedef msm::back::state_machine<Sm1_> Sm1; int main() { foo f; Sm1 sm1(std::move(f)); }
However, msm::back::state_machine cannot forward the arguments correctly. So I wrote the pull request that solves this issue.
msm::back::state_machine
Thank you!!
You did all the work. I only reviewed. Sorry for the very long delay!
I'd like to use a class that inherits state_machine_def and contains move only type member variables as follows:
However,
msm::back::state_machine
cannot forward the arguments correctly. So I wrote the pull request that solves this issue.