tmp/tmpll5ew398/{from.md → to.md}
RENAMED
|
@@ -13,10 +13,11 @@ operator-function-id:
|
|
| 13 |
operator operator
|
| 14 |
```
|
| 15 |
|
| 16 |
``` bnf
|
| 17 |
%% Ed. note: character protrusion would misalign various operators.
|
|
|
|
| 18 |
operator: one of
|
| 19 |
'new delete new[] delete[] co_await ( ) [ ] -> ->*'
|
| 20 |
'~ ! + - * / % ^ &'
|
| 21 |
'| = += -= *= /= %= ^= &='
|
| 22 |
'|= == != < > <= >= <=> &&'
|
|
@@ -71,40 +72,35 @@ explicitly stated in [[basic.stc.dynamic]].
|
|
| 71 |
|
| 72 |
The `co_await` operator is described completely in [[expr.await]]. The
|
| 73 |
attributes and restrictions found in the rest of [[over.oper]] do not
|
| 74 |
apply to it unless explicitly stated in [[expr.await]].
|
| 75 |
|
| 76 |
-
An operator function shall
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
class types by defining operator functions that implement these
|
| 87 |
-
operators. Likewise, the meaning of the operators (unary) `&` and `,`
|
| 88 |
-
(comma) can be changed for specific enumeration types. Operator
|
| 89 |
-
functions are inherited in the same manner as other base class
|
| 90 |
-
functions.
|
| 91 |
|
| 92 |
An operator function shall be a prefix unary, binary, function call,
|
| 93 |
subscripting, class member access, increment, or decrement operator
|
| 94 |
function.
|
| 95 |
|
| 96 |
[*Note 3*: The identities among certain predefined operators applied to
|
| 97 |
-
|
| 98 |
-
functions. Some predefined operators, such as `+=`, require an
|
| 99 |
-
to be an lvalue when applied to
|
| 100 |
-
operator functions. — *end note*]
|
| 101 |
|
| 102 |
An operator function cannot have default arguments [[dcl.fct.default]],
|
| 103 |
except where explicitly stated below. Operator functions cannot have
|
| 104 |
more or fewer parameters than the number required for the corresponding
|
| 105 |
operator, as described in the rest of [[over.oper]].
|
| 106 |
|
| 107 |
-
Operators not mentioned explicitly in subclauses [[over.
|
| 108 |
-
[[over.inc]] act as ordinary unary and binary operators obeying
|
| 109 |
-
rules of [[over.unary]] or [[over.binary]].
|
| 110 |
|
|
|
|
| 13 |
operator operator
|
| 14 |
```
|
| 15 |
|
| 16 |
``` bnf
|
| 17 |
%% Ed. note: character protrusion would misalign various operators.
|
| 18 |
+
|
| 19 |
operator: one of
|
| 20 |
'new delete new[] delete[] co_await ( ) [ ] -> ->*'
|
| 21 |
'~ ! + - * / % ^ &'
|
| 22 |
'| = += -= *= /= %= ^= &='
|
| 23 |
'|= == != < > <= >= <=> &&'
|
|
|
|
| 72 |
|
| 73 |
The `co_await` operator is described completely in [[expr.await]]. The
|
| 74 |
attributes and restrictions found in the rest of [[over.oper]] do not
|
| 75 |
apply to it unless explicitly stated in [[expr.await]].
|
| 76 |
|
| 77 |
+
An operator function shall have at least one function parameter or
|
| 78 |
+
implicit object parameter whose type is a class, a reference to a class,
|
| 79 |
+
an enumeration, or a reference to an enumeration. It is not possible to
|
| 80 |
+
change the precedence, grouping, or number of operands of operators. The
|
| 81 |
+
meaning of the operators `=`, (unary) `&`, and `,` (comma), predefined
|
| 82 |
+
for each type, can be changed for specific class types by defining
|
| 83 |
+
operator functions that implement these operators. Likewise, the meaning
|
| 84 |
+
of the operators (unary) `&` and `,` (comma) can be changed for specific
|
| 85 |
+
enumeration types. Operator functions are inherited in the same manner
|
| 86 |
+
as other base class functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
An operator function shall be a prefix unary, binary, function call,
|
| 89 |
subscripting, class member access, increment, or decrement operator
|
| 90 |
function.
|
| 91 |
|
| 92 |
[*Note 3*: The identities among certain predefined operators applied to
|
| 93 |
+
fundamental types (for example, `++a` ≡ `a+=1`) need not hold for
|
| 94 |
+
operator functions. Some predefined operators, such as `+=`, require an
|
| 95 |
+
operand to be an lvalue when applied to fundamental types; this is not
|
| 96 |
+
required by operator functions. — *end note*]
|
| 97 |
|
| 98 |
An operator function cannot have default arguments [[dcl.fct.default]],
|
| 99 |
except where explicitly stated below. Operator functions cannot have
|
| 100 |
more or fewer parameters than the number required for the corresponding
|
| 101 |
operator, as described in the rest of [[over.oper]].
|
| 102 |
|
| 103 |
+
Operators not mentioned explicitly in subclauses [[over.assign]]
|
| 104 |
+
through [[over.inc]] act as ordinary unary and binary operators obeying
|
| 105 |
+
the rules of [[over.unary]] or [[over.binary]].
|
| 106 |
|