Title
Must compound assignment operators be member functions?
Status
cd1
Section
12.4.3.2 [over.ass]
Submitter
Jim Hyslop

Created on 2000-04-03.00:00:00 last changed 196 months ago

Messages

Date: 2001-04-15.00:00:00

[Moved to DR at 4/01 meeting.]

Date: 2001-04-15.00:00:00

[Moved to DR at 4/01 meeting.]

Date: 2001-04-15.00:00:00

Proposed resolution (04/01):

  1. Change the title of 7.6.19 [expr.ass] from "Assignment operators" to "Assignment and compound assignment operators."

  2. Change the first sentence of 7.6.19 [expr.ass] paragraph 1 from

    There are several assignment operators, all of which group right-to-left. All require a modifiable lvalue as their left operand, and the type of an assignment expression is that of its left operand. The result of the assignment operation is the value stored in the left operand after the assignment has taken place; the result is an lvalue.

    to

    The assignment operator (=) and the compound assignment operators all group right-to-left. All require a modifiable lvalue as their left operand and return an lvalue with the type and value of the left operand after the assignment has taken place.

Additional note (10/00): Paragraphs 2-6 of 7.6.19 [expr.ass] should all be understood to apply to simple assignment only and not to compound assignment operators.

Date: 2000-04-15.00:00:00

Notes from 04/00 meeting:

Nearly all references to "assignment operator" in the IS mean operator= and not the compound assignment operators. The ARM was specific that this restriction applied only to operator=. If it did apply to compound assignment operators, it would be impossible to overload these operators for bool operands.

Date: 2000-04-03.00:00:00

Is the intent of 12.4.3.2 [over.ass] paragraph 1 that all assignment operators be non-static member functions (including operator+=, operator*=, etc.) or only simple assignment operators (operator=)?

History
Date User Action Args
2008-10-05 00:00:00adminsetstatus: wp -> cd1
2003-04-25 00:00:00adminsetstatus: dr -> wp
2002-05-10 00:00:00adminsetmessages: + msg688
2001-05-20 00:00:00adminsetstatus: ready -> dr
2000-11-18 00:00:00adminsetmessages: + msg402
2000-05-21 00:00:00adminsetmessages: + msg321
2000-05-21 00:00:00adminsetmessages: + msg320
2000-04-03 00:00:00admincreate