modern-cpp-features icon indicating copy to clipboard operation
modern-cpp-features copied to clipboard

Improve constexpr section

Open AnthonyCalandra opened this issue 6 years ago • 0 comments

The ASM output will probably not be useful for beginners. It might be easier to think of the following example like having the expression square(2) replaced with the value 4 at compile-time.

int a = square(2);

Additionally, mention that constexpr doesn't imply that the expression is guaranteed to be evaluated at compile-time, rather, it makes it explicit that the compiler can do so.

AnthonyCalandra avatar Feb 01 '20 23:02 AnthonyCalandra