This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-19


733. Reference qualification of copy assignment operators

Section: 11.4.6  [class.copy.assign]     Status: NAD     Submitter: Alberto Ganesh Barbati     Date: 9 October, 2008

For increased regularity between built-in types and class types, the copy assignment operator can be qualified with &, preventing assignment to an rvalue. The LWG is making that change in the Standard Library. It would seem a good idea to make a similar change, where possible, in the specification of implicitly-declared assignment operators. This would be the case when all subobjects of class type have a non-deleted copy assignment operator that is &-qualified.

Rationale (July, 2009):

The LWG decided not to add reference qualifiers in the library, which reduces the motivation for making this change to implicit assignment operators.

See also LWG issue 941 and paper N2819.