C++ Standard (4/5) the lvalue-to-rvalue conversion is not done on the operand of the unary & operator.
This quote is there just to confuse you. It has no other purpose. ;)
The most important quote is (quoting N3242, so the new terminology has "prvalue" instead of rvalue):
Whenever a glvalue expression appears as an operand of an operator that expects a prvalue for that operand, the lvalue-to-rvalue (4.1), array-to-pointer (4.2), or function-to-pointer (4.3) standard conversions are applied to convert the expression to a prvalue.
So the language could be described in term of constructs which expect a prvalue and constructs which do not. In particular, operator &
does not "expect a prvalue" (quite the contrary), so the lvalue-to-rvalue implicit conversion is not necessary and won't be applied.
The standard description is not consistent: it never explicitly says that in x += y
, the lvalue-to-rvalue implicit conversion is not applied to x
, presumably because it extremely obvious. Why the authors felt the need to explicitly say that for &x
, where it is equaly obvious, is beyond me.
I think these mentions that implicit conversions are not applied should be removed. The standard describe what happens, not the (infinitely many) things that do not happen (unless it is extremely surprising that it does not happen).
Implicit conversions are applied only to adjust the "nature" of an expression to the expectation of the context (context can be an expression, statement, declaration, ctor-init-list...).
What about this?
int &r = x;
I'm sure there will be no conversion in this statement,
because no implicit conversion is needed here. Implicit conversion are applied only when needed. Reference binding does not expect a rvalue.
but i'm confused how does & operator involve in this?
It is not.