tmp/tmpr0stix2r/{from.md → to.md}
RENAMED
|
@@ -1,17 +1,30 @@
|
|
| 1 |
### Unary operators <a id="over.unary">[[over.unary]]</a>
|
| 2 |
|
| 3 |
-
A prefix unary operator
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
[[over.match.oper]]
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
The unary and binary forms of the same operator are considered to have
|
| 13 |
the same name.
|
| 14 |
|
| 15 |
-
[*Note
|
| 16 |
from an enclosing scope, and vice versa. — *end note*]
|
| 17 |
|
|
|
|
| 1 |
### Unary operators <a id="over.unary">[[over.unary]]</a>
|
| 2 |
|
| 3 |
+
A *prefix unary operator function* is a function named `operator@` for a
|
| 4 |
+
prefix *unary-operator* `@` [[expr.unary.op]] that is either a
|
| 5 |
+
non-static member function [[class.mfct]] with no parameters or a
|
| 6 |
+
non-member function with one parameter. For a *unary-expression* of the
|
| 7 |
+
form `@ cast-expression`, the operator function is selected by overload
|
| 8 |
+
resolution [[over.match.oper]]. If a member function is selected, the
|
| 9 |
+
expression is interpreted as
|
| 10 |
+
|
| 11 |
+
``` bnf
|
| 12 |
+
cast-expression '.' operator '@' '('')'
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
Otherwise, if a non-member function is selected, the expression is
|
| 16 |
+
interpreted as
|
| 17 |
+
|
| 18 |
+
``` bnf
|
| 19 |
+
operator '@' '(' cast-expression ')'
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
[*Note 1*: The operators `++` and `\dcr` [[expr.pre.incr]] are
|
| 23 |
+
described in [[over.inc]]. — *end note*]
|
| 24 |
|
| 25 |
The unary and binary forms of the same operator are considered to have
|
| 26 |
the same name.
|
| 27 |
|
| 28 |
+
[*Note 2*: Consequently, a unary operator can hide a binary operator
|
| 29 |
from an enclosing scope, and vice versa. — *end note*]
|
| 30 |
|