- tmp/tmpjb27r_z4/{from.md → to.md} +104 -117
tmp/tmpjb27r_z4/{from.md → to.md}
RENAMED
|
@@ -2,11 +2,13 @@
|
|
| 2 |
|
| 3 |
The candidate operator functions that represent the built-in operators
|
| 4 |
defined in Clause [[expr]] are specified in this subclause. These
|
| 5 |
candidate functions participate in the operator overload resolution
|
| 6 |
process as described in [[over.match.oper]] and are used for no other
|
| 7 |
-
purpose.
|
|
|
|
|
|
|
| 8 |
type, and operator overload resolution occurs only when an operand
|
| 9 |
expression originally has class or enumeration type, operator overload
|
| 10 |
resolution can resolve to a built-in operator only when an operand has a
|
| 11 |
class type that has a user-defined conversion to a non-class type
|
| 12 |
appropriate for the operator, or when an operand has an enumeration type
|
|
@@ -17,99 +19,101 @@ in [[over.match.oper]], after a built-in operator is selected by
|
|
| 17 |
overload resolution the expression is subject to the requirements for
|
| 18 |
the built-in operator given in Clause [[expr]], and therefore to any
|
| 19 |
additional semantic constraints given there. If there is a user-written
|
| 20 |
candidate with the same name and parameter types as a built-in candidate
|
| 21 |
operator function, the built-in operator function is hidden and is not
|
| 22 |
-
included in the set of candidate functions.
|
| 23 |
|
| 24 |
In this subclause, the term *promoted integral type* is used to refer to
|
| 25 |
-
those integral types which are preserved by integral promotion
|
| 26 |
-
(including e.g. `int` and `long` but excluding e.g.
|
| 27 |
-
the term *promoted arithmetic type* refers to
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
the form
|
| 35 |
|
| 36 |
``` cpp
|
| 37 |
-
|
| 38 |
-
T operator
|
|
|
|
|
|
|
| 39 |
```
|
| 40 |
|
| 41 |
-
For every
|
| 42 |
-
*bool*, and *VQ* is either `volatile` or empty, there exist candidate
|
| 43 |
-
operator functions of the form
|
| 44 |
-
|
| 45 |
-
``` cpp
|
| 46 |
-
VQ T& operator--(VQ T&);
|
| 47 |
-
T operator--(VQ T&, int);
|
| 48 |
-
```
|
| 49 |
-
|
| 50 |
-
For every pair (*T*, *VQ*), where *T* is a cv-qualified or
|
| 51 |
-
cv-unqualified object type, and *VQ* is either `volatile` or empty,
|
| 52 |
-
there exist candidate operator functions of the form
|
| 53 |
-
|
| 54 |
-
``` cpp
|
| 55 |
-
T*VQ& operator++(T*VQ&);
|
| 56 |
-
T*VQ& operator--(T*VQ&);
|
| 57 |
-
T* operator++(T*VQ&, int);
|
| 58 |
-
T* operator--(T*VQ&, int);
|
| 59 |
-
```
|
| 60 |
-
|
| 61 |
-
For every cv-qualified or cv-unqualified object type *T*, there exist
|
| 62 |
candidate operator functions of the form
|
| 63 |
|
| 64 |
``` cpp
|
| 65 |
T& operator*(T*);
|
| 66 |
```
|
| 67 |
|
| 68 |
-
For every function type
|
| 69 |
*ref-qualifier*, there exist candidate operator functions of the form
|
| 70 |
|
| 71 |
``` cpp
|
| 72 |
T& operator*(T*);
|
| 73 |
```
|
| 74 |
|
| 75 |
-
For every type
|
| 76 |
|
| 77 |
``` cpp
|
| 78 |
T* operator+(T*);
|
| 79 |
```
|
| 80 |
|
| 81 |
-
For every promoted arithmetic type
|
| 82 |
functions of the form
|
| 83 |
|
| 84 |
``` cpp
|
| 85 |
T operator+(T);
|
| 86 |
T operator-(T);
|
| 87 |
```
|
| 88 |
|
| 89 |
-
For every promoted integral type
|
| 90 |
functions of the form
|
| 91 |
|
| 92 |
``` cpp
|
| 93 |
T operator~(T);
|
| 94 |
```
|
| 95 |
|
| 96 |
-
For every quintuple (
|
| 97 |
-
class type,
|
| 98 |
-
is an object type or a function type,
|
| 99 |
-
|
| 100 |
-
form
|
| 101 |
|
| 102 |
``` cpp
|
| 103 |
-
|
| 104 |
```
|
| 105 |
|
| 106 |
-
where *
|
| 107 |
for exposition only; see [[expr.mptr.oper]] for the determination of
|
| 108 |
the operator’s result type.
|
| 109 |
|
| 110 |
-
For every pair of promoted arithmetic types
|
| 111 |
candidate operator functions of the form
|
| 112 |
|
| 113 |
``` cpp
|
| 114 |
LR operator*(L, R);
|
| 115 |
LR operator/(L, R);
|
|
@@ -121,32 +125,32 @@ bool operator<=(L, R);
|
|
| 121 |
bool operator>=(L, R);
|
| 122 |
bool operator==(L, R);
|
| 123 |
bool operator!=(L, R);
|
| 124 |
```
|
| 125 |
|
| 126 |
-
where
|
| 127 |
-
types
|
| 128 |
|
| 129 |
-
For every cv-qualified or cv-unqualified object type
|
| 130 |
candidate operator functions of the form
|
| 131 |
|
| 132 |
``` cpp
|
| 133 |
T* operator+(T*, std::ptrdiff_t);
|
| 134 |
T& operator[](T*, std::ptrdiff_t);
|
| 135 |
T* operator-(T*, std::ptrdiff_t);
|
| 136 |
T* operator+(std::ptrdiff_t, T*);
|
| 137 |
T& operator[](std::ptrdiff_t, T*);
|
| 138 |
```
|
| 139 |
|
| 140 |
-
For every
|
| 141 |
candidate operator functions of the form
|
| 142 |
|
| 143 |
``` cpp
|
| 144 |
std::ptrdiff_t operator-(T, T);
|
| 145 |
```
|
| 146 |
|
| 147 |
-
For every
|
| 148 |
exist candidate operator functions of the form
|
| 149 |
|
| 150 |
``` cpp
|
| 151 |
bool operator<(T, T);
|
| 152 |
bool operator>(T, T);
|
|
@@ -154,19 +158,19 @@ bool operator<=(T, T);
|
|
| 154 |
bool operator>=(T, T);
|
| 155 |
bool operator==(T, T);
|
| 156 |
bool operator!=(T, T);
|
| 157 |
```
|
| 158 |
|
| 159 |
-
For every pointer to member type
|
| 160 |
exist candidate operator functions of the form
|
| 161 |
|
| 162 |
``` cpp
|
| 163 |
bool operator==(T, T);
|
| 164 |
bool operator!=(T, T);
|
| 165 |
```
|
| 166 |
|
| 167 |
-
For every pair of promoted integral types
|
| 168 |
candidate operator functions of the form
|
| 169 |
|
| 170 |
``` cpp
|
| 171 |
LR operator%(L, R);
|
| 172 |
LR operator&(L, R);
|
|
@@ -174,85 +178,85 @@ LR operator^(L, R);
|
|
| 174 |
LR operator|(L, R);
|
| 175 |
L operator<<(L, R);
|
| 176 |
L operator>>(L, R);
|
| 177 |
```
|
| 178 |
|
| 179 |
-
where
|
| 180 |
-
types
|
| 181 |
|
| 182 |
-
For every triple (
|
| 183 |
-
|
| 184 |
-
|
| 185 |
|
| 186 |
``` cpp
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
```
|
| 193 |
|
| 194 |
-
For every pair (
|
| 195 |
-
|
| 196 |
-
form
|
| 197 |
|
| 198 |
``` cpp
|
| 199 |
-
T*
|
| 200 |
```
|
| 201 |
|
| 202 |
-
For every pair (
|
| 203 |
-
member type
|
| 204 |
-
candidate operator functions of the form
|
| 205 |
|
| 206 |
``` cpp
|
| 207 |
-
|
| 208 |
```
|
| 209 |
|
| 210 |
-
For every pair (
|
| 211 |
-
cv-unqualified object type
|
| 212 |
-
|
| 213 |
|
| 214 |
``` cpp
|
| 215 |
-
T*
|
| 216 |
-
T*
|
| 217 |
```
|
| 218 |
|
| 219 |
-
For every triple (
|
| 220 |
-
|
| 221 |
-
|
| 222 |
|
| 223 |
``` cpp
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
```
|
| 231 |
|
| 232 |
There also exist candidate operator functions of the form
|
| 233 |
|
| 234 |
``` cpp
|
| 235 |
bool operator!(bool);
|
| 236 |
bool operator&&(bool, bool);
|
| 237 |
bool operator||(bool, bool);
|
| 238 |
```
|
| 239 |
|
| 240 |
-
For every pair of promoted arithmetic types
|
| 241 |
candidate operator functions of the form
|
| 242 |
|
| 243 |
``` cpp
|
| 244 |
LR operator?:(bool, L, R);
|
| 245 |
```
|
| 246 |
|
| 247 |
-
where
|
| 248 |
-
types
|
| 249 |
-
functions, this declaration serves only to describe the built-in
|
| 250 |
-
operator for purposes of overload resolution. The operator “`?:`” cannot
|
| 251 |
-
be overloaded.
|
| 252 |
|
| 253 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 254 |
enumeration type, there exist candidate operator functions of the form
|
| 255 |
|
| 256 |
``` cpp
|
| 257 |
T operator?:(bool, T, T);
|
| 258 |
```
|
|
@@ -273,10 +277,11 @@ T operator?:(bool, T, T);
|
|
| 273 |
[class.this]: class.md#class.this
|
| 274 |
[conv]: conv.md#conv
|
| 275 |
[conv.array]: conv.md#conv.array
|
| 276 |
[conv.bool]: conv.md#conv.bool
|
| 277 |
[conv.double]: conv.md#conv.double
|
|
|
|
| 278 |
[conv.fpint]: conv.md#conv.fpint
|
| 279 |
[conv.fpprom]: conv.md#conv.fpprom
|
| 280 |
[conv.func]: conv.md#conv.func
|
| 281 |
[conv.integral]: conv.md#conv.integral
|
| 282 |
[conv.lval]: conv.md#conv.lval
|
|
@@ -285,16 +290,19 @@ T operator?:(bool, T, T);
|
|
| 285 |
[conv.ptr]: conv.md#conv.ptr
|
| 286 |
[conv.qual]: conv.md#conv.qual
|
| 287 |
[cpp]: cpp.md#cpp
|
| 288 |
[dcl.array]: dcl.md#dcl.array
|
| 289 |
[dcl.fct]: dcl.md#dcl.fct
|
|
|
|
| 290 |
[dcl.fct.default]: dcl.md#dcl.fct.default
|
| 291 |
[dcl.init]: dcl.md#dcl.init
|
| 292 |
[dcl.init.aggr]: dcl.md#dcl.init.aggr
|
| 293 |
[dcl.init.list]: dcl.md#dcl.init.list
|
| 294 |
[dcl.init.ref]: dcl.md#dcl.init.ref
|
|
|
|
| 295 |
[dcl.typedef]: dcl.md#dcl.typedef
|
|
|
|
| 296 |
[expr]: expr.md#expr
|
| 297 |
[expr.ass]: expr.md#expr.ass
|
| 298 |
[expr.call]: expr.md#expr.call
|
| 299 |
[expr.cast]: expr.md#expr.cast
|
| 300 |
[expr.cond]: expr.md#expr.cond
|
|
@@ -325,10 +333,11 @@ T operator?:(bool, T, T);
|
|
| 325 |
[over.literal]: #over.literal
|
| 326 |
[over.load]: #over.load
|
| 327 |
[over.match]: #over.match
|
| 328 |
[over.match.best]: #over.match.best
|
| 329 |
[over.match.call]: #over.match.call
|
|
|
|
| 330 |
[over.match.conv]: #over.match.conv
|
| 331 |
[over.match.copy]: #over.match.copy
|
| 332 |
[over.match.ctor]: #over.match.ctor
|
| 333 |
[over.match.funcs]: #over.match.funcs
|
| 334 |
[over.match.list]: #over.match.list
|
|
@@ -406,33 +415,11 @@ T operator?:(bool, T, T);
|
|
| 406 |
tournament `F` encountered another function `G` such that `F` was
|
| 407 |
not better than `G`. Hence, `W` is either the best function or there
|
| 408 |
is no best function. So, make a second pass over the viable
|
| 409 |
functions to verify that `W` is better than all other functions.
|
| 410 |
|
| 411 |
-
[^11]:
|
| 412 |
-
|
| 413 |
-
argument can exist only if they involve different user-defined
|
| 414 |
-
conversions. The ambiguous conversion sequence is indistinguishable
|
| 415 |
-
from any other user-defined conversion sequence because it
|
| 416 |
-
represents at least two user-defined conversion sequences, each with
|
| 417 |
-
a different user-defined conversion, and any other user-defined
|
| 418 |
-
conversion sequence must be indistinguishable from at least one of
|
| 419 |
-
them.
|
| 420 |
|
| 421 |
-
|
| 422 |
-
ambiguous conversion sequence for one of its parameters. Consider
|
| 423 |
-
this example,
|
| 424 |
-
|
| 425 |
-
If it were not for this rule, `f(A)` would be eliminated as a viable
|
| 426 |
-
function for the call `f(b)` causing overload resolution to select
|
| 427 |
-
`f(C)` as the function to call even though it is not clearly the
|
| 428 |
-
best choice. On the other hand, if an `f(B)` were to be declared
|
| 429 |
-
then `f(b)` would resolve to that `f(B)` because the exact match
|
| 430 |
-
with `f(B)` is better than any of the sequences required to match
|
| 431 |
-
`f(A)`.
|
| 432 |
-
|
| 433 |
-
[^12]: Since there are no parameters of array type, this will only occur
|
| 434 |
-
as the underlying type of a reference parameter.
|
| 435 |
-
|
| 436 |
-
[^13]: Calling `operator++` explicitly, as in expressions like
|
| 437 |
`a.operator++(2)`, has no special properties: The argument to
|
| 438 |
`operator++` is `2`.
|
|
|
|
| 2 |
|
| 3 |
The candidate operator functions that represent the built-in operators
|
| 4 |
defined in Clause [[expr]] are specified in this subclause. These
|
| 5 |
candidate functions participate in the operator overload resolution
|
| 6 |
process as described in [[over.match.oper]] and are used for no other
|
| 7 |
+
purpose.
|
| 8 |
+
|
| 9 |
+
[*Note 1*: Because built-in operators take only operands with non-class
|
| 10 |
type, and operator overload resolution occurs only when an operand
|
| 11 |
expression originally has class or enumeration type, operator overload
|
| 12 |
resolution can resolve to a built-in operator only when an operand has a
|
| 13 |
class type that has a user-defined conversion to a non-class type
|
| 14 |
appropriate for the operator, or when an operand has an enumeration type
|
|
|
|
| 19 |
overload resolution the expression is subject to the requirements for
|
| 20 |
the built-in operator given in Clause [[expr]], and therefore to any
|
| 21 |
additional semantic constraints given there. If there is a user-written
|
| 22 |
candidate with the same name and parameter types as a built-in candidate
|
| 23 |
operator function, the built-in operator function is hidden and is not
|
| 24 |
+
included in the set of candidate functions. — *end note*]
|
| 25 |
|
| 26 |
In this subclause, the term *promoted integral type* is used to refer to
|
| 27 |
+
those integral types which are preserved by integral promotion (
|
| 28 |
+
[[conv.prom]]) (including e.g. `int` and `long` but excluding e.g.
|
| 29 |
+
`char`). Similarly, the term *promoted arithmetic type* refers to
|
| 30 |
+
floating types plus promoted integral types.
|
| 31 |
+
|
| 32 |
+
[*Note 2*: In all cases where a promoted integral type or promoted
|
| 33 |
+
arithmetic type is required, an operand of enumeration type will be
|
| 34 |
+
acceptable by way of the integral promotions. — *end note*]
|
| 35 |
+
|
| 36 |
+
In the remainder of this section, *vq* represents either `volatile` or
|
| 37 |
+
no cv-qualifier.
|
| 38 |
+
|
| 39 |
+
For every pair (`T`, *vq*), where `T` is an arithmetic type other than
|
| 40 |
+
`bool`, there exist candidate operator functions of the form
|
| 41 |
+
|
| 42 |
+
``` cpp
|
| 43 |
+
vq T& operator++(vq T&);
|
| 44 |
+
T operator++(vq T&, int);
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
For every pair (`T`, *vq*), where `T` is an arithmetic type other than
|
| 48 |
+
`bool`, there exist candidate operator functions of the form
|
| 49 |
+
|
| 50 |
+
``` cpp
|
| 51 |
+
vq T& operator--(vq T&);
|
| 52 |
+
T operator--(vq T&, int);
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
For every pair (`T`, *vq*), where `T` is a cv-qualified or
|
| 56 |
+
cv-unqualified object type, there exist candidate operator functions of
|
| 57 |
the form
|
| 58 |
|
| 59 |
``` cpp
|
| 60 |
+
T*vq& operator++(T*vq&);
|
| 61 |
+
T*vq& operator--(T*vq&);
|
| 62 |
+
T* operator++(T*vq&, int);
|
| 63 |
+
T* operator--(T*vq&, int);
|
| 64 |
```
|
| 65 |
|
| 66 |
+
For every cv-qualified or cv-unqualified object type `T`, there exist
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
candidate operator functions of the form
|
| 68 |
|
| 69 |
``` cpp
|
| 70 |
T& operator*(T*);
|
| 71 |
```
|
| 72 |
|
| 73 |
+
For every function type `T` that does not have cv-qualifiers or a
|
| 74 |
*ref-qualifier*, there exist candidate operator functions of the form
|
| 75 |
|
| 76 |
``` cpp
|
| 77 |
T& operator*(T*);
|
| 78 |
```
|
| 79 |
|
| 80 |
+
For every type `T` there exist candidate operator functions of the form
|
| 81 |
|
| 82 |
``` cpp
|
| 83 |
T* operator+(T*);
|
| 84 |
```
|
| 85 |
|
| 86 |
+
For every promoted arithmetic type `T`, there exist candidate operator
|
| 87 |
functions of the form
|
| 88 |
|
| 89 |
``` cpp
|
| 90 |
T operator+(T);
|
| 91 |
T operator-(T);
|
| 92 |
```
|
| 93 |
|
| 94 |
+
For every promoted integral type `T`, there exist candidate operator
|
| 95 |
functions of the form
|
| 96 |
|
| 97 |
``` cpp
|
| 98 |
T operator~(T);
|
| 99 |
```
|
| 100 |
|
| 101 |
+
For every quintuple (`C1`, `C2`, `T`, *cv1*, *cv2*), where `C2` is a
|
| 102 |
+
class type, `C1` is the same type as `C2` or is a derived class of `C2`,
|
| 103 |
+
and `T` is an object type or a function type, there exist candidate
|
| 104 |
+
operator functions of the form
|
|
|
|
| 105 |
|
| 106 |
``` cpp
|
| 107 |
+
cv12 T& operator->*(cv1 C1*, cv2 T C2::*);
|
| 108 |
```
|
| 109 |
|
| 110 |
+
where *cv12* is the union of *cv1* and *cv2*. The return type is shown
|
| 111 |
for exposition only; see [[expr.mptr.oper]] for the determination of
|
| 112 |
the operator’s result type.
|
| 113 |
|
| 114 |
+
For every pair of promoted arithmetic types `L` and `R`, there exist
|
| 115 |
candidate operator functions of the form
|
| 116 |
|
| 117 |
``` cpp
|
| 118 |
LR operator*(L, R);
|
| 119 |
LR operator/(L, R);
|
|
|
|
| 125 |
bool operator>=(L, R);
|
| 126 |
bool operator==(L, R);
|
| 127 |
bool operator!=(L, R);
|
| 128 |
```
|
| 129 |
|
| 130 |
+
where `LR` is the result of the usual arithmetic conversions between
|
| 131 |
+
types `L` and `R`.
|
| 132 |
|
| 133 |
+
For every cv-qualified or cv-unqualified object type `T` there exist
|
| 134 |
candidate operator functions of the form
|
| 135 |
|
| 136 |
``` cpp
|
| 137 |
T* operator+(T*, std::ptrdiff_t);
|
| 138 |
T& operator[](T*, std::ptrdiff_t);
|
| 139 |
T* operator-(T*, std::ptrdiff_t);
|
| 140 |
T* operator+(std::ptrdiff_t, T*);
|
| 141 |
T& operator[](std::ptrdiff_t, T*);
|
| 142 |
```
|
| 143 |
|
| 144 |
+
For every `T`, where `T` is a pointer to object type, there exist
|
| 145 |
candidate operator functions of the form
|
| 146 |
|
| 147 |
``` cpp
|
| 148 |
std::ptrdiff_t operator-(T, T);
|
| 149 |
```
|
| 150 |
|
| 151 |
+
For every `T`, where `T` is an enumeration type or a pointer type, there
|
| 152 |
exist candidate operator functions of the form
|
| 153 |
|
| 154 |
``` cpp
|
| 155 |
bool operator<(T, T);
|
| 156 |
bool operator>(T, T);
|
|
|
|
| 158 |
bool operator>=(T, T);
|
| 159 |
bool operator==(T, T);
|
| 160 |
bool operator!=(T, T);
|
| 161 |
```
|
| 162 |
|
| 163 |
+
For every pointer to member type `T` or type `std::nullptr_t` there
|
| 164 |
exist candidate operator functions of the form
|
| 165 |
|
| 166 |
``` cpp
|
| 167 |
bool operator==(T, T);
|
| 168 |
bool operator!=(T, T);
|
| 169 |
```
|
| 170 |
|
| 171 |
+
For every pair of promoted integral types `L` and `R`, there exist
|
| 172 |
candidate operator functions of the form
|
| 173 |
|
| 174 |
``` cpp
|
| 175 |
LR operator%(L, R);
|
| 176 |
LR operator&(L, R);
|
|
|
|
| 178 |
LR operator|(L, R);
|
| 179 |
L operator<<(L, R);
|
| 180 |
L operator>>(L, R);
|
| 181 |
```
|
| 182 |
|
| 183 |
+
where `LR` is the result of the usual arithmetic conversions between
|
| 184 |
+
types `L` and `R`.
|
| 185 |
|
| 186 |
+
For every triple (`L`, *vq*, `R`), where `L` is an arithmetic type, and
|
| 187 |
+
`R` is a promoted arithmetic type, there exist candidate operator
|
| 188 |
+
functions of the form
|
| 189 |
|
| 190 |
``` cpp
|
| 191 |
+
vq L& operator=(vq L&, R);
|
| 192 |
+
vq L& operator*=(vq L&, R);
|
| 193 |
+
vq L& operator/=(vq L&, R);
|
| 194 |
+
vq L& operator+=(vq L&, R);
|
| 195 |
+
vq L& operator-=(vq L&, R);
|
| 196 |
```
|
| 197 |
|
| 198 |
+
For every pair (`T`, *vq*), where `T` is any type, there exist candidate
|
| 199 |
+
operator functions of the form
|
|
|
|
| 200 |
|
| 201 |
``` cpp
|
| 202 |
+
T*vq& operator=(T*vq&, T*);
|
| 203 |
```
|
| 204 |
|
| 205 |
+
For every pair (`T`, *vq*), where `T` is an enumeration or pointer to
|
| 206 |
+
member type, there exist candidate operator functions of the form
|
|
|
|
| 207 |
|
| 208 |
``` cpp
|
| 209 |
+
vq T& operator=(vq T&, T);
|
| 210 |
```
|
| 211 |
|
| 212 |
+
For every pair (`T`, *vq*), where `T` is a cv-qualified or
|
| 213 |
+
cv-unqualified object type, there exist candidate operator functions of
|
| 214 |
+
the form
|
| 215 |
|
| 216 |
``` cpp
|
| 217 |
+
T*vq& operator+=(T*vq&, std::ptrdiff_t);
|
| 218 |
+
T*vq& operator-=(T*vq&, std::ptrdiff_t);
|
| 219 |
```
|
| 220 |
|
| 221 |
+
For every triple (`L`, *vq*, `R`), where `L` is an integral type, and
|
| 222 |
+
`R` is a promoted integral type, there exist candidate operator
|
| 223 |
+
functions of the form
|
| 224 |
|
| 225 |
``` cpp
|
| 226 |
+
vq L& operator%=(vq L&, R);
|
| 227 |
+
vq L& operator<<=(vq L&, R);
|
| 228 |
+
vq L& operator>>=(vq L&, R);
|
| 229 |
+
vq L& operator&=(vq L&, R);
|
| 230 |
+
vq L& operator^=(vq L&, R);
|
| 231 |
+
vq L& operator|=(vq L&, R);
|
| 232 |
```
|
| 233 |
|
| 234 |
There also exist candidate operator functions of the form
|
| 235 |
|
| 236 |
``` cpp
|
| 237 |
bool operator!(bool);
|
| 238 |
bool operator&&(bool, bool);
|
| 239 |
bool operator||(bool, bool);
|
| 240 |
```
|
| 241 |
|
| 242 |
+
For every pair of promoted arithmetic types `L` and `R`, there exist
|
| 243 |
candidate operator functions of the form
|
| 244 |
|
| 245 |
``` cpp
|
| 246 |
LR operator?:(bool, L, R);
|
| 247 |
```
|
| 248 |
|
| 249 |
+
where `LR` is the result of the usual arithmetic conversions between
|
| 250 |
+
types `L` and `R`.
|
|
|
|
|
|
|
|
|
|
| 251 |
|
| 252 |
+
[*Note 3*: As with all these descriptions of candidate functions, this
|
| 253 |
+
declaration serves only to describe the built-in operator for purposes
|
| 254 |
+
of overload resolution. The operator “`?:`” cannot be
|
| 255 |
+
overloaded. — *end note*]
|
| 256 |
+
|
| 257 |
+
For every type `T`, where `T` is a pointer, pointer-to-member, or scoped
|
| 258 |
enumeration type, there exist candidate operator functions of the form
|
| 259 |
|
| 260 |
``` cpp
|
| 261 |
T operator?:(bool, T, T);
|
| 262 |
```
|
|
|
|
| 277 |
[class.this]: class.md#class.this
|
| 278 |
[conv]: conv.md#conv
|
| 279 |
[conv.array]: conv.md#conv.array
|
| 280 |
[conv.bool]: conv.md#conv.bool
|
| 281 |
[conv.double]: conv.md#conv.double
|
| 282 |
+
[conv.fctptr]: conv.md#conv.fctptr
|
| 283 |
[conv.fpint]: conv.md#conv.fpint
|
| 284 |
[conv.fpprom]: conv.md#conv.fpprom
|
| 285 |
[conv.func]: conv.md#conv.func
|
| 286 |
[conv.integral]: conv.md#conv.integral
|
| 287 |
[conv.lval]: conv.md#conv.lval
|
|
|
|
| 290 |
[conv.ptr]: conv.md#conv.ptr
|
| 291 |
[conv.qual]: conv.md#conv.qual
|
| 292 |
[cpp]: cpp.md#cpp
|
| 293 |
[dcl.array]: dcl.md#dcl.array
|
| 294 |
[dcl.fct]: dcl.md#dcl.fct
|
| 295 |
+
[dcl.fct.def.delete]: dcl.md#dcl.fct.def.delete
|
| 296 |
[dcl.fct.default]: dcl.md#dcl.fct.default
|
| 297 |
[dcl.init]: dcl.md#dcl.init
|
| 298 |
[dcl.init.aggr]: dcl.md#dcl.init.aggr
|
| 299 |
[dcl.init.list]: dcl.md#dcl.init.list
|
| 300 |
[dcl.init.ref]: dcl.md#dcl.init.ref
|
| 301 |
+
[dcl.init.string]: dcl.md#dcl.init.string
|
| 302 |
[dcl.typedef]: dcl.md#dcl.typedef
|
| 303 |
+
[except.spec]: except.md#except.spec
|
| 304 |
[expr]: expr.md#expr
|
| 305 |
[expr.ass]: expr.md#expr.ass
|
| 306 |
[expr.call]: expr.md#expr.call
|
| 307 |
[expr.cast]: expr.md#expr.cast
|
| 308 |
[expr.cond]: expr.md#expr.cond
|
|
|
|
| 333 |
[over.literal]: #over.literal
|
| 334 |
[over.load]: #over.load
|
| 335 |
[over.match]: #over.match
|
| 336 |
[over.match.best]: #over.match.best
|
| 337 |
[over.match.call]: #over.match.call
|
| 338 |
+
[over.match.class.deduct]: #over.match.class.deduct
|
| 339 |
[over.match.conv]: #over.match.conv
|
| 340 |
[over.match.copy]: #over.match.copy
|
| 341 |
[over.match.ctor]: #over.match.ctor
|
| 342 |
[over.match.funcs]: #over.match.funcs
|
| 343 |
[over.match.list]: #over.match.list
|
|
|
|
| 415 |
tournament `F` encountered another function `G` such that `F` was
|
| 416 |
not better than `G`. Hence, `W` is either the best function or there
|
| 417 |
is no best function. So, make a second pass over the viable
|
| 418 |
functions to verify that `W` is better than all other functions.
|
| 419 |
|
| 420 |
+
[^11]: Since there are no parameters of array type, this will only occur
|
| 421 |
+
as the referenced type of a reference parameter.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 422 |
|
| 423 |
+
[^12]: Calling `operator++` explicitly, as in expressions like
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 424 |
`a.operator++(2)`, has no special properties: The argument to
|
| 425 |
`operator++` is `2`.
|