logoalt Hacker News

loegtoday at 4:48 PM1 replyview on HN

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.


Replies

xigoitoday at 9:24 PM

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