I'm now learning how to use static_assert. What I learned so far is that the argument of the static_assert has to be constant expression. For the following code, I don't know why the argument reference is not a constant expression: It is declared as const and initialized by integral constant 0:
int main()
{
const int &reference = 0;
static_assert(reference);
}
The error message from gcc states that the reference is not usable in a constant expression:
error: 'reference' is not usable in a constant expression.
Is there a standard rule that prohibits reference from being usable in constant expressions so that it is not a constant expression?