2 ms·
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
by loeg 8mo 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.
- xigoi 8mo agoOne of the many frustrating things about C++ is that “const” means “immutable” and “constexpr” means “constant”.