1

How can I implement radio buttons in boost meta state machine?
The problem is the amount of transitions grows quadratically, e.g. with 3 buttons the options are:

1 -> 2
1 -> 3
2 -> 1
2 -> 3
3 -> 1
3 -> 2

But with 4 buttons the options are:

1 -> 2
1 -> 3
1 -> 4
2 -> 1
2 -> 3
2 -> 4
3 -> 1
3 -> 2
3 -> 4
4 -> 1
4 -> 2
4 -> 3

Is there a way to do something like

{2, 3, 4} -> 1
{1, 3, 4} -> 2
{1, 2, 4} -> 3
{1, 2, 3} -> 4

in boost meta state machine?

ildjarn
  • 62,044
  • 9
  • 127
  • 211
Daniel
  • 30,896
  • 18
  • 85
  • 139
  • 3
    Why would you _want_ to do this? Each state can go to any other state. At which point, there's no state machine. A state machine exists to provide a _restriction_ on which states have valid transitions to other states. You want any state to be able to go to any other. So what do you gain by using a state machine? – Nicol Bolas Oct 15 '11 at 20:43

0 Answers0