↧
Answer by Sergey Kalinichenko for Is `const constexpr` on variables redundant?
In declarations with primitives, such as the one in your example, const is indeed redundant. However, there may be odd situations where const would be required, for exampleconstexpr int someConstant =...
View ArticleAnswer by Maxim Egorushkin for Is `const constexpr` on variables redundant?
const is redundant in const constexpr for objects.Does "object declaration" mean "any variable declaration"?It does.As per cppreference, a variable or a constant is an object:A variable is an object or...
View ArticleIs `const constexpr` on variables redundant?
cppreference states that:A constexpr specifier used in an object declaration or non-static member function (until C++14) implies const.Does "object declaration" mean "any variable declaration"?I.e....
View Article