Files
2025-10-25 03:02:53 +03:00

2.2 KiB

[expr.post.incr]

7 Expressions [expr]

7.6 Compound expressions [expr.compound]

7.6.1 Postfix expressions [expr.post]

7.6.1.6 Increment and decrement [expr.post.incr]

1

#

The value of a postfix ++ expression is the value obtained by applying the lvalue-to-rvalue conversion ([conv.lval]) to its operand.

[Note 1:

The value obtained is a copy of the original value.

— end note]

The operand shall be a modifiable lvalue.

The type of the operand shall be an arithmetic type other than cv bool, or a pointer to a complete object type.

An operand with volatile-qualified type is deprecated; see [depr.volatile.type].

The value of the operand object is modified ([defns.access]) as if it were the operand of the prefix ++ operator ([expr.pre.incr]).

Thevalue computation of the ++ expression is sequenced before the modification of the operand object.

With respect to an indeterminately-sequenced function call, the operation of postfix++ is a single evaluation.

[Note 2:

Therefore, a function call cannot intervene between the lvalue-to-rvalue conversion and the side effect associated with any single postfix ++ operator.

— end note]

The result is a prvalue.

The type of the result is the cv-unqualified version of the type of the operand.

2

#

The operand of postfix -- is decremented analogously to the postfix ++ operator.

[Note 3:

For prefix increment and decrement, see [expr.pre.incr].

— end note]