tmp/tmp5ux_3pwz/{from.md → to.md}
RENAMED
|
@@ -7,11 +7,13 @@ defines the prefix increment operator `++` for objects of that type. If
|
|
| 7 |
the function is a non-static member function with one parameter (which
|
| 8 |
shall be of type `int`) or a non-member function with two parameters
|
| 9 |
(the second of which shall be of type `int`), it defines the postfix
|
| 10 |
increment operator `++` for objects of that type. When the postfix
|
| 11 |
increment is called as a result of using the `++` operator, the `int`
|
| 12 |
-
argument will have value zero.[^
|
|
|
|
|
|
|
| 13 |
|
| 14 |
``` cpp
|
| 15 |
struct X {
|
| 16 |
X& operator++(); // prefix ++a
|
| 17 |
X operator++(int); // postfix a++
|
|
@@ -32,8 +34,10 @@ void f(X a, Y b) {
|
|
| 32 |
operator++(b); // explicit call: like ++b;
|
| 33 |
operator++(b, 0); // explicit call: like b++;
|
| 34 |
}
|
| 35 |
```
|
| 36 |
|
|
|
|
|
|
|
| 37 |
The prefix and postfix decrement operators `-{-}` are handled
|
| 38 |
analogously.
|
| 39 |
|
|
|
|
| 7 |
the function is a non-static member function with one parameter (which
|
| 8 |
shall be of type `int`) or a non-member function with two parameters
|
| 9 |
(the second of which shall be of type `int`), it defines the postfix
|
| 10 |
increment operator `++` for objects of that type. When the postfix
|
| 11 |
increment is called as a result of using the `++` operator, the `int`
|
| 12 |
+
argument will have value zero.[^12]
|
| 13 |
+
|
| 14 |
+
[*Example 1*:
|
| 15 |
|
| 16 |
``` cpp
|
| 17 |
struct X {
|
| 18 |
X& operator++(); // prefix ++a
|
| 19 |
X operator++(int); // postfix a++
|
|
|
|
| 34 |
operator++(b); // explicit call: like ++b;
|
| 35 |
operator++(b, 0); // explicit call: like b++;
|
| 36 |
}
|
| 37 |
```
|
| 38 |
|
| 39 |
+
— *end example*]
|
| 40 |
+
|
| 41 |
The prefix and postfix decrement operators `-{-}` are handled
|
| 42 |
analogously.
|
| 43 |
|