Summary
In this chapter, we explored techniques for compile-time computation in C++. We covered the basics of TMP and provided an in-depth explanation of the constexpr specifier, using examples relevant to embedded systems.
With the knowledge from this chapter, you can generate lookup tables and convert human-readable addresses, UUIDs, and similar data into arrays used by communication stacks, all at compile time. This allows you to write expressive code that generates complex mathematical signals without consuming extra memory or processing time.
Next, we will go over the techniques used in writing a HAL in C++.
Join our community on Discord
Join our community’s Discord space for discussions with the author and other readers:
https://packt.link/embeddedsystems
