Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. struct E {
  2. };
  3.  
  4. struct A : public boost::msm::front::state<> {
  5. template <class TStateMachine>
  6. void on_entry(E const& event, TStateMachine& stateMachine) {
  7. }
  8.  
  9. template <class TStateMachine>
  10. void on_exit(E const& event, TStateMachine& stateMachine) {
  11. }
  12. };
  13.  
  14. struct B: public boost::msm::front::state<> {
  15. template <class TStateMachine>
  16. void on_entry(E const& event, TStateMachine& stateMachine) {
  17. }
  18.  
  19. template <class TStateMachine>
  20. void on_exit(E const& event, TStateMachine& stateMachine) {
  21. }
  22. };
  23.  
  24. struct SubMachineDefinition : public boost::msm::front::state_machine_def<SubMachineDefinition> {
  25. typedef boost::msm::front::state_machine_def<SubMachineDefinition> Base;
  26.  
  27. typedef A initial_state;
  28.  
  29. struct transition_table : boost::mpl::vector<
  30. typename Base::template _row<A, E, B>
  31. > {};
  32. };
  33.  
  34. struct SuperMachineDefinition : public boost::msm::front::state_machine_def<SuperMachineDefinition > {
  35. typedef SubMachineDefinition initial_state;
  36.  
  37. struct transition_table : boost::mpl::vector<> {};
  38. };
  39.  
  40. void main() {
  41. boost::msm::back::state_machine<SuperMachineDefinition> states;
  42. states.start();
  43. states.process_event(E()); // This crashes
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement