const's primary function is to express the idea that an object is not modified through an interface (even though the object may very well be modified through other interfaces) - http://www.stroustrup.com/C++11FAQ.html#constexpr |
|
|
In addition to be able to evaluate expressions at compile time, we want to be able to require expressions to be evaluated at compile time; constexpr in front of a variable definition does that (and implies const): ... constexpr's primary function is to extend the range of what can be computed at compile time, making such computation type safe. - Stroustrup |