Expression A(1) is rvalue 5.2.3 [expr.type.conv].
When initializing a const reference (function argument) with an expression that is an rvalue, the compiler can create a temporary one and copy the value of this expression into a temporary one and bind this link to this temporary one. 8.5.3 [dcl.init.ref] / 5.
[...] The constructor that will be used to create the copy can be called regardless of whether the copy is actually running.
Note that this behavior is due to a change in the next version of C ++. In the new standard, the const reference, initialized from the prvalue class, must be bound directly to the reference object; in this case, you cannot create temporary capabilities, and the copy constructor is not used or not required.
Charles Bailey Jan 19 '11 at 9:40 2011-01-19 09:40
source share