tmp/tmpow_gv29j/{from.md → to.md}
RENAMED
|
@@ -6,18 +6,22 @@ a secondary comparison operator `@` shall have a declared return type
|
|
| 6 |
`bool`.
|
| 7 |
|
| 8 |
The operator function with parameters `x` and `y` is defined as deleted
|
| 9 |
if
|
| 10 |
|
| 11 |
-
- overload resolution [[over.match]], as applied to `x @ y`,
|
| 12 |
-
result in a usable candidate, or
|
| 13 |
-
- the
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
|
| 17 |
-
function is not considered as a candidate
|
| 18 |
-
the `@
|
| 19 |
|
| 20 |
[*Example 1*:
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
struct HasNoLessThan { };
|
|
@@ -33,10 +37,12 @@ struct C {
|
|
| 33 |
<!-- Link reference definitions -->
|
| 34 |
[basic.align]: basic.md#basic.align
|
| 35 |
[basic.compound]: basic.md#basic.compound
|
| 36 |
[basic.def]: basic.md#basic.def
|
| 37 |
[basic.def.odr]: basic.md#basic.def.odr
|
|
|
|
|
|
|
| 38 |
[basic.life]: basic.md#basic.life
|
| 39 |
[basic.link]: basic.md#basic.link
|
| 40 |
[basic.lookup]: basic.md#basic.lookup
|
| 41 |
[basic.lookup.elab]: basic.md#basic.lookup.elab
|
| 42 |
[basic.lval]: expr.md#basic.lval
|
|
@@ -48,10 +54,11 @@ struct C {
|
|
| 48 |
[basic.start.term]: basic.md#basic.start.term
|
| 49 |
[basic.stc.auto]: basic.md#basic.stc.auto
|
| 50 |
[basic.stc.static]: basic.md#basic.stc.static
|
| 51 |
[basic.stc.thread]: basic.md#basic.stc.thread
|
| 52 |
[basic.types]: basic.md#basic.types
|
|
|
|
| 53 |
[class]: #class
|
| 54 |
[class.abstract]: #class.abstract
|
| 55 |
[class.access]: #class.access
|
| 56 |
[class.access.base]: #class.access.base
|
| 57 |
[class.access.general]: #class.access.general
|
|
@@ -115,13 +122,15 @@ struct C {
|
|
| 115 |
[cmp.weakord]: support.md#cmp.weakord
|
| 116 |
[conv]: expr.md#conv
|
| 117 |
[conv.mem]: expr.md#conv.mem
|
| 118 |
[conv.ptr]: expr.md#conv.ptr
|
| 119 |
[conv.rval]: expr.md#conv.rval
|
|
|
|
|
|
|
| 120 |
[dcl.array]: dcl.md#dcl.array
|
| 121 |
[dcl.attr.nouniqueaddr]: dcl.md#dcl.attr.nouniqueaddr
|
| 122 |
-
[dcl.
|
| 123 |
[dcl.decl]: dcl.md#dcl.decl
|
| 124 |
[dcl.enum]: dcl.md#dcl.enum
|
| 125 |
[dcl.fct]: dcl.md#dcl.fct
|
| 126 |
[dcl.fct.def]: dcl.md#dcl.fct.def
|
| 127 |
[dcl.fct.def.coroutine]: dcl.md#dcl.fct.def.coroutine
|
|
@@ -135,10 +144,11 @@ struct C {
|
|
| 135 |
[dcl.init.general]: dcl.md#dcl.init.general
|
| 136 |
[dcl.init.list]: dcl.md#dcl.init.list
|
| 137 |
[dcl.init.ref]: dcl.md#dcl.init.ref
|
| 138 |
[dcl.inline]: dcl.md#dcl.inline
|
| 139 |
[dcl.meaning]: dcl.md#dcl.meaning
|
|
|
|
| 140 |
[dcl.name]: dcl.md#dcl.name
|
| 141 |
[dcl.spec.auto]: dcl.md#dcl.spec.auto
|
| 142 |
[dcl.stc]: dcl.md#dcl.stc
|
| 143 |
[dcl.type.cv]: dcl.md#dcl.type.cv
|
| 144 |
[dcl.type.elab]: dcl.md#dcl.type.elab
|
|
@@ -147,14 +157,13 @@ struct C {
|
|
| 147 |
[depr.impldec]: future.md#depr.impldec
|
| 148 |
[depr.static.constexpr]: future.md#depr.static.constexpr
|
| 149 |
[diff.class]: compatibility.md#diff.class
|
| 150 |
[except.ctor]: except.md#except.ctor
|
| 151 |
[except.handle]: except.md#except.handle
|
| 152 |
-
[except.pre]: except.md#except.pre
|
| 153 |
[except.spec]: except.md#except.spec
|
| 154 |
[except.throw]: except.md#except.throw
|
| 155 |
-
[expr.
|
| 156 |
[expr.call]: expr.md#expr.call
|
| 157 |
[expr.cast]: expr.md#expr.cast
|
| 158 |
[expr.const]: expr.md#expr.const
|
| 159 |
[expr.const.cast]: expr.md#expr.const.cast
|
| 160 |
[expr.delete]: expr.md#expr.delete
|
|
@@ -174,39 +183,42 @@ struct C {
|
|
| 174 |
[expr.type.conv]: expr.md#expr.type.conv
|
| 175 |
[expr.typeid]: expr.md#expr.typeid
|
| 176 |
[expr.unary.op]: expr.md#expr.unary.op
|
| 177 |
[intro.execution]: basic.md#intro.execution
|
| 178 |
[intro.object]: basic.md#intro.object
|
|
|
|
|
|
|
| 179 |
[namespace.udecl]: dcl.md#namespace.udecl
|
| 180 |
[over]: over.md#over
|
| 181 |
-
[over.
|
| 182 |
[over.best.ics]: over.md#over.best.ics
|
| 183 |
[over.binary]: over.md#over.binary
|
| 184 |
-
[over.ics.ref]: over.md#over.ics.ref
|
| 185 |
[over.match]: over.md#over.match
|
| 186 |
[over.match.best]: over.md#over.match.best
|
| 187 |
[over.match.call]: over.md#over.match.call
|
| 188 |
[over.match.copy]: over.md#over.match.copy
|
| 189 |
[over.match.funcs]: over.md#over.match.funcs
|
|
|
|
|
|
|
| 190 |
[over.oper]: over.md#over.oper
|
| 191 |
[over.over]: over.md#over.over
|
| 192 |
[special]: #special
|
| 193 |
[stmt.dcl]: stmt.md#stmt.dcl
|
| 194 |
[stmt.return]: stmt.md#stmt.return
|
| 195 |
[string.classes]: strings.md#string.classes
|
| 196 |
[temp.arg]: temp.md#temp.arg
|
| 197 |
[temp.constr]: temp.md#temp.constr
|
| 198 |
[temp.constr.order]: temp.md#temp.constr.order
|
| 199 |
[temp.deduct.guide]: temp.md#temp.deduct.guide
|
| 200 |
-
[temp.dep.type]: temp.md#temp.dep.type
|
| 201 |
[temp.expl.spec]: temp.md#temp.expl.spec
|
| 202 |
[temp.explicit]: temp.md#temp.explicit
|
| 203 |
[temp.friend]: temp.md#temp.friend
|
| 204 |
[temp.inst]: temp.md#temp.inst
|
| 205 |
[temp.mem]: temp.md#temp.mem
|
| 206 |
[temp.param]: temp.md#temp.param
|
| 207 |
[temp.pre]: temp.md#temp.pre
|
|
|
|
| 208 |
[temp.spec.partial]: temp.md#temp.spec.partial
|
| 209 |
[temp.variadic]: temp.md#temp.variadic
|
| 210 |
[term.incomplete.type]: basic.md#term.incomplete.type
|
| 211 |
[term.layout.compatible.type]: basic.md#term.layout.compatible.type
|
| 212 |
[term.object.representation]: basic.md#term.object.representation
|
|
@@ -215,61 +227,46 @@ struct C {
|
|
| 215 |
|
| 216 |
[^1]: This ensures that two subobjects that have the same class type and
|
| 217 |
that belong to the same most derived object are not allocated at the
|
| 218 |
same address [[expr.eq]].
|
| 219 |
|
| 220 |
-
[^2]:
|
| 221 |
-
|
| 222 |
-
[^3]: This implies that the reference parameter of the
|
| 223 |
implicitly-declared copy constructor cannot bind to a `volatile`
|
| 224 |
lvalue; see [[diff.class]].
|
| 225 |
|
| 226 |
-
[^
|
| 227 |
taking an rvalue reference parameter is never a copy assignment
|
| 228 |
operator, the presence of such an assignment operator does not
|
| 229 |
suppress the implicit declaration of a copy assignment operator.
|
| 230 |
Such assignment operators participate in overload resolution with
|
| 231 |
other assignment operators, including copy assignment operators,
|
| 232 |
and, if selected, will be used to assign an object.
|
| 233 |
|
| 234 |
-
[^
|
| 235 |
implicitly-declared copy assignment operator cannot bind to a
|
| 236 |
`volatile` lvalue; see [[diff.class]].
|
| 237 |
|
| 238 |
-
[^
|
| 239 |
-
purposes of overload resolution [[over.best.ics]], [[over.ics.ref]]
|
| 240 |
-
and therefore initialization [[dcl.init]] and explicit casts
|
| 241 |
-
[[expr.static.cast]]. A conversion to `void` does not invoke any
|
| 242 |
-
conversion function [[expr.static.cast]]. Even though never directly
|
| 243 |
-
called to perform a conversion, such conversion functions can be
|
| 244 |
-
declared and can potentially be reached through a call to a virtual
|
| 245 |
-
conversion function in a base class.
|
| 246 |
-
|
| 247 |
-
[^7]: The use of the `virtual` specifier in the declaration of an
|
| 248 |
overriding function is valid but redundant (has empty semantics).
|
| 249 |
|
| 250 |
-
[^
|
| 251 |
still polymorphic even if its internal representation does not
|
| 252 |
otherwise require any additions for that polymorphic behavior.
|
| 253 |
|
| 254 |
-
[^
|
| 255 |
[[over]] as a virtual function is not necessarily virtual and does
|
| 256 |
not override. Access control [[class.access]] is not considered in
|
| 257 |
determining overriding.
|
| 258 |
|
| 259 |
-
[^
|
| 260 |
pointers to classes are not allowed.
|
| 261 |
|
| 262 |
-
[^
|
| 263 |
and local classes.
|
| 264 |
|
| 265 |
-
[^
|
| 266 |
base class remain inaccessible even to derived classes unless friend
|
| 267 |
declarations within the base class definition are used to grant
|
| 268 |
access explicitly.
|
| 269 |
|
| 270 |
-
[^
|
| 271 |
static data members or enumerator member constants.
|
| 272 |
-
|
| 273 |
-
[^14]: Because only one object is destroyed instead of two, and one
|
| 274 |
-
copy/move constructor is not executed, there is still one object
|
| 275 |
-
destroyed for each one constructed.
|
|
|
|
| 6 |
`bool`.
|
| 7 |
|
| 8 |
The operator function with parameters `x` and `y` is defined as deleted
|
| 9 |
if
|
| 10 |
|
| 11 |
+
- a first overload resolution [[over.match]], as applied to `x @ y`,
|
| 12 |
+
- does not result in a usable candidate, or
|
| 13 |
+
- the selected candidate is not a rewritten candidate, or
|
| 14 |
+
- a second overload resolution for the expression resulting from the
|
| 15 |
+
interpretation of `x @ y` using the selected rewritten candidate
|
| 16 |
+
[[over.match.oper]] does not result in a usable candidate (for
|
| 17 |
+
example, that expression might be `(x <=> y) @ 0`), or
|
| 18 |
+
- `x @ y` cannot be implicitly converted to `bool`.
|
| 19 |
|
| 20 |
+
In any of the two overload resolutions above, the defaulted operator
|
| 21 |
+
function is not considered as a candidate for the `@` operator.
|
| 22 |
+
Otherwise, the operator function yields `x @ y`.
|
| 23 |
|
| 24 |
[*Example 1*:
|
| 25 |
|
| 26 |
``` cpp
|
| 27 |
struct HasNoLessThan { };
|
|
|
|
| 37 |
<!-- Link reference definitions -->
|
| 38 |
[basic.align]: basic.md#basic.align
|
| 39 |
[basic.compound]: basic.md#basic.compound
|
| 40 |
[basic.def]: basic.md#basic.def
|
| 41 |
[basic.def.odr]: basic.md#basic.def.odr
|
| 42 |
+
[basic.fundamental]: basic.md#basic.fundamental
|
| 43 |
+
[basic.indet]: basic.md#basic.indet
|
| 44 |
[basic.life]: basic.md#basic.life
|
| 45 |
[basic.link]: basic.md#basic.link
|
| 46 |
[basic.lookup]: basic.md#basic.lookup
|
| 47 |
[basic.lookup.elab]: basic.md#basic.lookup.elab
|
| 48 |
[basic.lval]: expr.md#basic.lval
|
|
|
|
| 54 |
[basic.start.term]: basic.md#basic.start.term
|
| 55 |
[basic.stc.auto]: basic.md#basic.stc.auto
|
| 56 |
[basic.stc.static]: basic.md#basic.stc.static
|
| 57 |
[basic.stc.thread]: basic.md#basic.stc.thread
|
| 58 |
[basic.types]: basic.md#basic.types
|
| 59 |
+
[basic.types.general]: basic.md#basic.types.general
|
| 60 |
[class]: #class
|
| 61 |
[class.abstract]: #class.abstract
|
| 62 |
[class.access]: #class.access
|
| 63 |
[class.access.base]: #class.access.base
|
| 64 |
[class.access.general]: #class.access.general
|
|
|
|
| 122 |
[cmp.weakord]: support.md#cmp.weakord
|
| 123 |
[conv]: expr.md#conv
|
| 124 |
[conv.mem]: expr.md#conv.mem
|
| 125 |
[conv.ptr]: expr.md#conv.ptr
|
| 126 |
[conv.rval]: expr.md#conv.rval
|
| 127 |
+
[cpp.cond]: cpp.md#cpp.cond
|
| 128 |
+
[dcl.align]: dcl.md#dcl.align
|
| 129 |
[dcl.array]: dcl.md#dcl.array
|
| 130 |
[dcl.attr.nouniqueaddr]: dcl.md#dcl.attr.nouniqueaddr
|
| 131 |
+
[dcl.contract.func]: dcl.md#dcl.contract.func
|
| 132 |
[dcl.decl]: dcl.md#dcl.decl
|
| 133 |
[dcl.enum]: dcl.md#dcl.enum
|
| 134 |
[dcl.fct]: dcl.md#dcl.fct
|
| 135 |
[dcl.fct.def]: dcl.md#dcl.fct.def
|
| 136 |
[dcl.fct.def.coroutine]: dcl.md#dcl.fct.def.coroutine
|
|
|
|
| 144 |
[dcl.init.general]: dcl.md#dcl.init.general
|
| 145 |
[dcl.init.list]: dcl.md#dcl.init.list
|
| 146 |
[dcl.init.ref]: dcl.md#dcl.init.ref
|
| 147 |
[dcl.inline]: dcl.md#dcl.inline
|
| 148 |
[dcl.meaning]: dcl.md#dcl.meaning
|
| 149 |
+
[dcl.meaning.general]: dcl.md#dcl.meaning.general
|
| 150 |
[dcl.name]: dcl.md#dcl.name
|
| 151 |
[dcl.spec.auto]: dcl.md#dcl.spec.auto
|
| 152 |
[dcl.stc]: dcl.md#dcl.stc
|
| 153 |
[dcl.type.cv]: dcl.md#dcl.type.cv
|
| 154 |
[dcl.type.elab]: dcl.md#dcl.type.elab
|
|
|
|
| 157 |
[depr.impldec]: future.md#depr.impldec
|
| 158 |
[depr.static.constexpr]: future.md#depr.static.constexpr
|
| 159 |
[diff.class]: compatibility.md#diff.class
|
| 160 |
[except.ctor]: except.md#except.ctor
|
| 161 |
[except.handle]: except.md#except.handle
|
|
|
|
| 162 |
[except.spec]: except.md#except.spec
|
| 163 |
[except.throw]: except.md#except.throw
|
| 164 |
+
[expr.assign]: expr.md#expr.assign
|
| 165 |
[expr.call]: expr.md#expr.call
|
| 166 |
[expr.cast]: expr.md#expr.cast
|
| 167 |
[expr.const]: expr.md#expr.const
|
| 168 |
[expr.const.cast]: expr.md#expr.const.cast
|
| 169 |
[expr.delete]: expr.md#expr.delete
|
|
|
|
| 183 |
[expr.type.conv]: expr.md#expr.type.conv
|
| 184 |
[expr.typeid]: expr.md#expr.typeid
|
| 185 |
[expr.unary.op]: expr.md#expr.unary.op
|
| 186 |
[intro.execution]: basic.md#intro.execution
|
| 187 |
[intro.object]: basic.md#intro.object
|
| 188 |
+
[meta.reflection.define.aggregate]: meta.md#meta.reflection.define.aggregate
|
| 189 |
+
[module.reach]: module.md#module.reach
|
| 190 |
[namespace.udecl]: dcl.md#namespace.udecl
|
| 191 |
[over]: over.md#over
|
| 192 |
+
[over.assign]: over.md#over.assign
|
| 193 |
[over.best.ics]: over.md#over.best.ics
|
| 194 |
[over.binary]: over.md#over.binary
|
|
|
|
| 195 |
[over.match]: over.md#over.match
|
| 196 |
[over.match.best]: over.md#over.match.best
|
| 197 |
[over.match.call]: over.md#over.match.call
|
| 198 |
[over.match.copy]: over.md#over.match.copy
|
| 199 |
[over.match.funcs]: over.md#over.match.funcs
|
| 200 |
+
[over.match.general]: over.md#over.match.general
|
| 201 |
+
[over.match.oper]: over.md#over.match.oper
|
| 202 |
[over.oper]: over.md#over.oper
|
| 203 |
[over.over]: over.md#over.over
|
| 204 |
[special]: #special
|
| 205 |
[stmt.dcl]: stmt.md#stmt.dcl
|
| 206 |
[stmt.return]: stmt.md#stmt.return
|
| 207 |
[string.classes]: strings.md#string.classes
|
| 208 |
[temp.arg]: temp.md#temp.arg
|
| 209 |
[temp.constr]: temp.md#temp.constr
|
| 210 |
[temp.constr.order]: temp.md#temp.constr.order
|
| 211 |
[temp.deduct.guide]: temp.md#temp.deduct.guide
|
|
|
|
| 212 |
[temp.expl.spec]: temp.md#temp.expl.spec
|
| 213 |
[temp.explicit]: temp.md#temp.explicit
|
| 214 |
[temp.friend]: temp.md#temp.friend
|
| 215 |
[temp.inst]: temp.md#temp.inst
|
| 216 |
[temp.mem]: temp.md#temp.mem
|
| 217 |
[temp.param]: temp.md#temp.param
|
| 218 |
[temp.pre]: temp.md#temp.pre
|
| 219 |
+
[temp.spec.general]: temp.md#temp.spec.general
|
| 220 |
[temp.spec.partial]: temp.md#temp.spec.partial
|
| 221 |
[temp.variadic]: temp.md#temp.variadic
|
| 222 |
[term.incomplete.type]: basic.md#term.incomplete.type
|
| 223 |
[term.layout.compatible.type]: basic.md#term.layout.compatible.type
|
| 224 |
[term.object.representation]: basic.md#term.object.representation
|
|
|
|
| 227 |
|
| 228 |
[^1]: This ensures that two subobjects that have the same class type and
|
| 229 |
that belong to the same most derived object are not allocated at the
|
| 230 |
same address [[expr.eq]].
|
| 231 |
|
| 232 |
+
[^2]: This implies that the reference parameter of the
|
|
|
|
|
|
|
| 233 |
implicitly-declared copy constructor cannot bind to a `volatile`
|
| 234 |
lvalue; see [[diff.class]].
|
| 235 |
|
| 236 |
+
[^3]: Because a template assignment operator or an assignment operator
|
| 237 |
taking an rvalue reference parameter is never a copy assignment
|
| 238 |
operator, the presence of such an assignment operator does not
|
| 239 |
suppress the implicit declaration of a copy assignment operator.
|
| 240 |
Such assignment operators participate in overload resolution with
|
| 241 |
other assignment operators, including copy assignment operators,
|
| 242 |
and, if selected, will be used to assign an object.
|
| 243 |
|
| 244 |
+
[^4]: This implies that the reference parameter of the
|
| 245 |
implicitly-declared copy assignment operator cannot bind to a
|
| 246 |
`volatile` lvalue; see [[diff.class]].
|
| 247 |
|
| 248 |
+
[^5]: The use of the `virtual` specifier in the declaration of an
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
overriding function is valid but redundant (has empty semantics).
|
| 250 |
|
| 251 |
+
[^6]: If all virtual functions are immediate functions, the class is
|
| 252 |
still polymorphic even if its internal representation does not
|
| 253 |
otherwise require any additions for that polymorphic behavior.
|
| 254 |
|
| 255 |
+
[^7]: A function with the same name but a different parameter list
|
| 256 |
[[over]] as a virtual function is not necessarily virtual and does
|
| 257 |
not override. Access control [[class.access]] is not considered in
|
| 258 |
determining overriding.
|
| 259 |
|
| 260 |
+
[^8]: Multi-level pointers to classes or references to multi-level
|
| 261 |
pointers to classes are not allowed.
|
| 262 |
|
| 263 |
+
[^9]: Access permissions are thus transitive and cumulative to nested
|
| 264 |
and local classes.
|
| 265 |
|
| 266 |
+
[^10]: As specified previously in [[class.access]], private members of a
|
| 267 |
base class remain inaccessible even to derived classes unless friend
|
| 268 |
declarations within the base class definition are used to grant
|
| 269 |
access explicitly.
|
| 270 |
|
| 271 |
+
[^11]: This additional check does not apply to other members, e.g.,
|
| 272 |
static data members or enumerator member constants.
|
|
|
|
|
|
|
|
|
|
|
|