Embedded

Implementing a State Machine in C++17 – part 2

In my previous article we’ve talked about implementing a simple state machine based on a std::variant and other newer additions to the C++ standard. Even though the implementation had its merits it was far from being complete. In this article, we improve upon that design to make it more useful and easy to use. (więcej…)

Embedded

Implementing a State Machine in C++17

Finite State Machines are a very useful concept that allows modeling complex behavior. The basic idea is quite simple. We have a set of possible states and we define rules that govern transitions between the current state and some other state upon receiving an event. So how to implement one in C++17? Of course, there is a multitude of ways to do it. In this article, we try to explore another possibility based on several newer additions to the C++ standard. (więcej…)