Home > On-Demand Archives > Q&A Sessions >
Live Q&A - Modern C++ in Embedded Development: Expressive Compile-Time Computation
Amar Mahmutbegovic - Watch Now - EOC 2024
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.
16:40:19 From Gonzalo to Everyone: What is the oldest C++ version where all that is on your presentation is possible? 16:46:59 From BobF to Everyone: You have a partial single-phase V-I example in the slides, have you attempted to evaluate reactive and apparent power .... let alone for 3-phase systems? 16:47:59 From Raul Pando to Everyone: Based on your professional experience using embedded C++, do you tend to resort to the latest standard revision available where possible (c++23 these days?) or do you find yourself constrained by other factors, such client build systems? 16:49:35 From BobF to Everyone: I'll download the slides again ... it was on the 'Expressive signal generator' slide 16:50:14 From David to Everyone: Have you compared GCC, IAR, CLANG, or Green Hills and if so can you share your experience? 16:53:41 From Raul Pando to Everyone: I think the signal structure was just an example to leverage some of the flexibilitity "modern" features (lambdas with sine & consine). 16:54:34 From David to Everyone: Thanks for a very interesting presentation! 16:56:22 From BobF to Everyone: Yes, SIN (voltage) / COS (current) graph, also on the 'constexpr - generate array' slide 16:56:45 From Lyden Smith to Everyone: Thank you Amar! 16:56:53 From Raul Pando to Everyone: Thank you Amar 16:58:15 From BobF to Everyone: Thanks Amar, well done! 16:59:09 From Cameron to Everyone: Thanks Amar 16:59:11 From Raul Pando to Everyone: Great advice
When would someone use constexpr verse consteval?