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

2024-11-11


1481. Increment/decrement operators with reference parameters

Section: 12.4.7  [over.inc]     Status: CD3     Submitter: Ryou Ezoe     Date: 2012-03-20

[Moved to DR at the April, 2013 meeting.]

The phrase in 12.4.7 [over.inc] paragraph 1,

a non-member function with one parameter of class or enumeration type

inadvertently excludes reference parameters, and in fact, no mention of the type is necessary in light of 12.4 [over.oper] paragraph 6:

An operator function shall either be a non-static member function or be a non-member function and have at least one parameter whose type is a class, a reference to a class, an enumeration, or a reference to an enumeration.

Proposed resolution (August, 2012):

Change 12.4.7 [over.inc] paragraph 1 as follows:

The user-defined function called operator++ implements the prefix and postfix ++ operator. If this function is a member function with no parameters, or a non-member function with one parameter of class or enumeration type, it defines the prefix increment operator ++ for objects of that type. If the function...