tmp/tmp0ogf31yq/{from.md → to.md}
RENAMED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
### Increment and decrement <a id="over.inc">[[over.inc]]</a>
|
| 2 |
|
| 3 |
The user-defined function called `operator++` implements the prefix and
|
| 4 |
-
postfix `++` operator. If this function is a member function
|
| 5 |
-
parameters, or a non-member function with one parameter
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
|
| 14 |
``` cpp
|
| 15 |
struct X {
|
| 16 |
X& operator++(); // prefix ++a
|
| 17 |
X operator++(int); // postfix a++
|
|
|
|
| 1 |
### Increment and decrement <a id="over.inc">[[over.inc]]</a>
|
| 2 |
|
| 3 |
The user-defined function called `operator++` implements the prefix and
|
| 4 |
+
postfix `++` operator. If this function is a non-static member function
|
| 5 |
+
with no parameters, or a non-member function with one parameter, it
|
| 6 |
+
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]
|
| 13 |
|
| 14 |
``` cpp
|
| 15 |
struct X {
|
| 16 |
X& operator++(); // prefix ++a
|
| 17 |
X operator++(int); // postfix a++
|