Embedded

Implementing a State Machine in C++17 – part 3 – compile time strings

In the previous series of articles (part1, part2) we’ve played with a simple state machine with some basic functionality. As the machine grows bigger, the need for debugging utilities becomes more important. To implement such utilities we need to do some groundwork first. All state, event, and action names are known at compile-time and for most of them, we could easily generate a string with the name during compilation. What’s problematic is that some of the types could be parametrized and would require some form of compile-time string concatenation. That’s exactly what we are going to explore in this article 🙂

(więcej…)