Below is some code the exemplifies the user of constexpr. Why could I not use "const" instead?
1 2 3 4 5 6 7 8 9
constexprint max = 100;
void use(int n)
{
constexprint c1 = max+7; // OK: c1 is 107
constint c2 = n+7; // OK, but don’t try to change the value of c2
// ...
c2 = 7; // error: c2 is a const
}
Such