From Jason Turner

[over.unary]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpr0stix2r/{from.md → to.md} +22 -9
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 shall be implemented by a non-static member
4
- function ([[class.mfct]]) with no parameters or a non-member function
5
- with one parameter. Thus, for any prefix unary operator `@`, `@x` can be
6
- interpreted as either `x.operator@()` or `operator@(x)`. If both forms
7
- of the operator function have been declared, the rules in 
8
- [[over.match.oper]] determine which, if any, interpretation is used.
9
- See  [[over.inc]] for an explanation of the postfix unary operators `++`
10
- and `\dcr`.
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
  The unary and binary forms of the same operator are considered to have
13
  the same name.
14
 
15
- [*Note 1*: Consequently, a unary operator can hide a binary operator
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