Z
ZMZ
I've read from a number of sources about the following statements,
they make sense to me but I can't find similar statement in the
standard. My question is: are the following statements true? Thanks.
The addition (multiplication, etc) operator expects both of its two
operands to be rvalue, and the result of the expression is rvalue. So
there is definitely an lvalue-to-rvalue conversion if the supplied
operands are lvalues.
The left side of assignment operator is expected to be lvalue, and the
right side of the assignment operator is expected to be rvalue. So if
the right side is an lvalue, lvalue-to-rvalue conversion will be
performed too.
There are also something slightly different statements from the
Internet, e.g., somebody in his tutorial on lvalue and rvalue thinks
that, the addition etc operator operand can be lvalue or rvalue, so
according to his statement, there's no need to have an lvalue-to-
rvalue conversion if the supplied operand is lvalue.
Thanks for reading.
they make sense to me but I can't find similar statement in the
standard. My question is: are the following statements true? Thanks.
The addition (multiplication, etc) operator expects both of its two
operands to be rvalue, and the result of the expression is rvalue. So
there is definitely an lvalue-to-rvalue conversion if the supplied
operands are lvalues.
The left side of assignment operator is expected to be lvalue, and the
right side of the assignment operator is expected to be rvalue. So if
the right side is an lvalue, lvalue-to-rvalue conversion will be
performed too.
There are also something slightly different statements from the
Internet, e.g., somebody in his tutorial on lvalue and rvalue thinks
that, the addition etc operator operand can be lvalue or rvalue, so
according to his statement, there's no need to have an lvalue-to-
rvalue conversion if the supplied operand is lvalue.
Thanks for reading.