Prefix forms of the built-in operators return references and postfix forms return values, and typical user-defined overloads follow the pattern so that the user-defined operators can be used in the same manner as the built-ins. However, in a user-defined operator overload, any type can be used as return type (including void).

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

The int parameter is a dummy parameter used to differentiate between pre- and post- in versions of the operators. When the user-defined postfix operator is called, the value passed in that parameter is always zero, although it may be changed by calling the operator using function call notation, e.g. a.operator++(2).

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

For every optionally volatile-qualified arithmetic type A other than bool, and for every optionally volatile-qualified pointer P to optionally cv-qualified object type, the following function signatures participate in overload resolution:

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

The operand of a built-in prefix increment or decrement operator must be a modifiable lvalue (non-const reference) of non-boolean arithmetic type or pointer to complete object type. For these operands, the expression ++x is exactly equivalent to x+=1, and the expression --x is exactly equivalent to x-=1, that is, the result is the updated operand, returned as lvalue, and all arithmetic conversion rules and pointer arithmetic rules defined for operatori aritmetici apply.

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

For every optionally volatile-qualified arithmetic type A other than bool, and for every optionally volatile-qualified pointer P to optionally cv-qualified object type, the following function signatures participate in overload resolution:

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

The operand of a built-in postfix increment or decrement operator must be a modifiable lvalue (non-const reference) of non-boolean arithmetic type or pointer to complete object type. The result is a prvalue, which is a copy the original value of the operand. As a side-effect, this operator modifies the value of its argument arg as if by evaluating arg +=1 or arg -=1, for increment and decrement respectively. All arithmetic conversion rules and pointer arithmetic rules defined for operatori aritmetici apply.

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

Increment and decrement operators are overloaded for many standard library types. In particular, every Iterator overloads operator++ and every BidirectionalIterator overloads operator--, even if those operators are no-ops for the particular iterator.

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

sovraccarichi per i tipi aritmetici

Original:

overloads for arithmetic types

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.