You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is an rvalue (but not a bit-field) or function lvalue and “cv1 T1” is reference-compatible with “cv2 T2”, or
has a class type (i.e., T2 is a class type), where T1 is not reference-related to T2, and can be converted to an rvalue or function lvalue of type “cv3 T3”, where “cv1 T1” is reference-compatible with “cv3 T3” (see [over.match.ref]),
then the value of the initializer expression in the first case and the result of the conversion in the second case is called the converted initializer. [....]
the value of the initializer expression sounds a bit strange, it seems that an lvalue-to-rvalue conversion would apply to the original initializer expression(if necessary) to convert it be a prvalue in order to read the value, as per [basic.lval#5]
The result of a prvalue is the value that the expression stores into its context; a prvalue that has type cv void has no result. A prvalue whose result is the value V is sometimes said to have or name the value V.
In my mind, an "rvalue" is either a "xvalue" or a "prvalue", Its glvalue(possible-converted) could be directly bound to reference. Why do we say "the value of the initializer expression in the first case" here? We just need to say that
the initializer expression in the first case...
is sufficient.
The wording "the value of the initializer expression" keeps using since the c++11 standard, that is
then the reference is bound to the value of the initializer expression in the first case and to
the result of the conversion in the second case (or, in either case, to an appropriate base class
subobject).
But, in that document, the value of an expression seems to be not well-defined and has a different meaning in the current standard, hence, the wording is not suitable now.
The text was updated successfully, but these errors were encountered:
xmh0511
changed the title
A lvalue-to-rvalue conversion is necessary in [dcl.init.ref#5.3]?
A lvalue-to-rvalue conversion is not necessary to be required in [dcl.init.ref#5.3]
Jul 19, 2021
the value of the initializer expression sounds a bit strange, it seems that an lvalue-to-rvalue conversion would apply to the original initializer expression(if necessary) to convert it be a prvalue in order to read the value, as per [basic.lval#5]
In my mind, an "rvalue" is either a "xvalue" or a "prvalue", Its glvalue(possible-converted) could be directly bound to reference. Why do we say "the value of the initializer expression in the first case" here? We just need to say that
is sufficient.
The wording "the value of the initializer expression" keeps using since the c++11 standard, that is
But, in that document, the value of an expression seems to be not well-defined and has a different meaning in the current standard, hence, the wording is not suitable now.
The text was updated successfully, but these errors were encountered: