Important reminder just in the Preface :-)
Takeaway #1: "C and C++ are different: don’t mix them, and don’t mix them up"
replies(8):
Takeaway #1: "C and C++ are different: don’t mix them, and don’t mix them up"
This is how I managed to sneak C++ into an embedded C codebase. We even created some templates for data structures that supported static allocation at compile time.
Yes you can do it less cleanly with macros or inline functions. But you can't do it performantly with struct and function pointers.