|
For the form a = b = c, both the return value and the reference can be
For the form (a = b) = c, of course, returning an object is not possible, from another perspective
It can also be explained that because the return value creates a temporary object, and the temporary object is in
C ++ is const. It is not possible to assign to a const quantity.
A detailed explanation is given in "effective C ++" item15, comprehensively used in various situations, for = no other choice,
Returns a reference,
For individual cases, you can use some forms to return objects and the like. Step by step analysis, you can draw conclusions. |
|