tmp/tmp4hzoilm7/{from.md → to.md}
RENAMED
|
@@ -1,16 +1,17 @@
|
|
| 1 |
### Increment and decrement <a id="over.inc">[[over.inc]]</a>
|
| 2 |
|
| 3 |
An *increment operator function* is a function named `operator++`. If
|
| 4 |
-
this function is a non-static member function with no
|
| 5 |
-
non-member function with one parameter, it defines the
|
| 6 |
-
operator `++` for objects of that type. If the function
|
| 7 |
-
member function with one parameter (which
|
| 8 |
-
|
| 9 |
-
type `int`), it defines the postfix
|
| 10 |
-
of that type. When the postfix
|
| 11 |
-
the `++` operator, the `int`
|
|
|
|
| 12 |
|
| 13 |
[*Example 1*:
|
| 14 |
|
| 15 |
``` cpp
|
| 16 |
struct X {
|
|
@@ -35,8 +36,8 @@ void f(X a, Y b) {
|
|
| 35 |
}
|
| 36 |
```
|
| 37 |
|
| 38 |
— *end example*]
|
| 39 |
|
| 40 |
-
A *decrement operator function* is a function named `operator
|
| 41 |
-
|
| 42 |
|
|
|
|
| 1 |
### Increment and decrement <a id="over.inc">[[over.inc]]</a>
|
| 2 |
|
| 3 |
An *increment operator function* is a function named `operator++`. If
|
| 4 |
+
this function is a non-static member function with no non-object
|
| 5 |
+
parameters, or a non-member function with one parameter, it defines the
|
| 6 |
+
prefix increment operator `++` for objects of that type. If the function
|
| 7 |
+
is a non-static member function with one non-object 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.[^9]
|
| 13 |
|
| 14 |
[*Example 1*:
|
| 15 |
|
| 16 |
``` cpp
|
| 17 |
struct X {
|
|
|
|
| 36 |
}
|
| 37 |
```
|
| 38 |
|
| 39 |
— *end example*]
|
| 40 |
|
| 41 |
+
A *decrement operator function* is a function named `operator--` and is
|
| 42 |
+
handled analogously to an increment operator function.
|
| 43 |
|