Modern C++ in Embedded Development: Expressive Compile-Time Computation
C++11 made a significant impact on C++, bringing in features such as auto, lambdas, and constexpr. These features modernized language, making it more expressive.
This talk guides embedded developers who dominantly use C for their daily tasks through compile-time evaluation of functions and expressions in C++. It demonstrates language capabilities to generate lookup tables and mathematical signals in compile time while providing expressive abstractions similar to Matlab.
The talk will help embedded developers to better understand modern C++ capabilities, and it will cover the following topics:
- Constexpr variables,
- Constexpr functions,
- Operator overloading,
- Lambdas,
- Templates,
- Abbreviated function template.
The talk aims to demonstrate C++’s compile-time computation capability through a practical example while gradually guiding the audience through the language features needed to build the example.
What did Amar identify as the primary benefit of using constexpr for computations in embedded systems?
You would use consteval to enforce compile-time evaluation. Calling consteval function with run-time arguments would result in compile error.
Constexpr functions can be used both with const expressions and run-time arguments.





When would someone use constexpr verse consteval?