Why can't unary operator & be applied to constants?

I came across this:

"The & operator only applies to objects in memory: variables and array elements. It cannot be applied to expressions, constants, or register variables."

I understand why & can't be applied to expressions. But why can't you apply them to a constant? I assume just like a variable, a constant is stored in an addressable memory cell.
Whoever wrote the sentence, mixed up quite a few concepts. What they probably meant by a 'constant' was an integer or floating-point literal: you can't write int* p = &10;)

The address-of operator can be applied to lvalue expressions and cannot be applied to rvalue expressions. I generally see it is the primary distinction between lvalues and rvalues. Variables (named objects and references) as well as array member access expressions are examples of lvalue expressions.

(in C, it also cannot be applied to register variables, but this is a C++ forum :)
Topic archived. No new replies allowed.