Finite State Machine with std::variant - Vending Machine -- Bartlomiej Filipek

In my last article, we discussed Finite State Machines based on std::variant and some cool C++17 techniques. Today I want to go further and show you an example of a Vending Machine implementation.

Finite State Machine with std::variant - Vending Machine

By Bartlomiej Filipek

From the article:

Here’s a basic diagram that illustrates how the machine is going to work:

vending_states.png

Following the model from the last article, each state and the event will be a separate small structure. Later we can “pack” them into std::variant.

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.