Boost logo

Boost :

From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2008-08-08 12:55:30

David Abrahams wrote:
> on Tue Aug 05 2008, Andrey Semashev <> wrote:
>> David Abrahams wrote:
>>> on Tue Aug 05 2008, Chris Knight <> wrote:
>>> I don't know if you've seen the FSM examples from "C++ Template
>>> Metaprogramming" or not. It would be interesting for this library's
>>> documentation to explain its advantages over that approach (I can see
>>> some from here already).
>> No, I don't have that book.
> For your perusal:

Thanks for the info. I guess I'm not the first one who came up with such
approach. :)

My implementation has similarities to player2.cpp, however, there are
significant advantages in Boost.FSM.
- The library does not take addresses of user's functions, which allows
to use templates and simplifies overloading.
- States are not an enum values but classes that may have a common
virtual base, which allows to have state-specific and shared data in the
FSM. The events are processed in states.
- States support enter and leave handlers. There is also a reset method
that allows to clear the states and silently transit to the initial state.
- Other minor things, like auto-generated state names, dynamic handler
for unsupported events, thread-safety issues, etc.

I'd love to put a full comparison to the library documentation, but I
feel this would be not... fair (for the lack of a better word) since I
didn't read the book and only seen a couple of examples.

Boost list run by bdawes at, gregod at, cpdaniel at, john at