← Back to context

Comment by loeg

5 hours ago

It is required to be evaluated at compile time, and it's const.

An optimizing compiler might see through a non-constexpr declaration like 'double a0 = ...' or it might not. Constexpr is somewhat more explicit, especially with more complicated initializer expressions.

One of the many frustrating things about C++ is that “const” means “immutable” and “constexpr” means “constant”.