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:
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.


C++23 will be the next C++ standard after C++20. This new standard significantly improves C++ but is less game-changing than C++98, C++11, or C++20. C++23 is more in the tradition of C++17.
Sometimes you want to add an implicit conversion to a type. This can be done by adding an implicit conversion operator. For example,
In my last post "Monitor Object" I implemented a thread-safe queue. I made two serious errors. Sorry. Today, I will fix these issues.
This article goes over the spicy topic of object ownership. We covered the lifetime quirks, and we found out that manual memory management can be a nightmare, we 
Visual Studio 17.6 comes with new functionality in the Address Sanitizer runtime which provides a new “checked build” for C and C++. This new runtime mode diagnoses and reports hidden memory safety errors, with zero false positives, as your app runs.
The latest major version of the