This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See for the official list.


185. "Named" temporaries and copy elision

Section:  [class.copy.ctor]     Status: TC1     Submitter: Bill Wade     Date: 11 Nov 1999 [class.copy.ctor] paragraph 15 refers only to "temporary class objects." It needs to be made clear that these provisions do not apply to temporaries that have been bound to references. For instance,

    struct A {
        mutable int value;
        explicit A(int i) : value(i) {}
        void mutate(int i) const { value = i; }

    int foo() {
        A const& t = A(1);
        A n(t);          // can this copy be elided?
        return n.value;  // can this return 2?
The current wording seems to allow an implementation not to perform the copy in A N(t) because the source object is a temporary (created explicitly by A(1)).

Proposed resolution (10/00):

Change the wording proposed in the resolution of issue 20 from