
Hi Christophe, <snip>
You can make a circular buffer of, say, boost::function<void()>, this allows you to anonymize functors, for example this can be assigned into this boost::function: template<class Fsm, class Event> struct process_some_event { process_some_event(Fsm* fsm): fsm_(fsm){} void operator()() { fsm_->process_event(Event()); } Fsm* fsm_; };
Or as a variant, you can make a boost::function<void(my_fsm&)> with the corresponding operator(). Whatever fits better in your case.
Yes, that could be a good solution. I haven't had time to try that way yet but I will as soon as I can. This discussion and similar stuff should go into the docs or some examples file. Perhaps it would help more people? It has certainly been of great help to me. Regards, Mathias