tmp/tmpc6ef5vm6/{from.md → to.md}
RENAMED
|
@@ -1,26 +1,27 @@
|
|
| 1 |
### Overload resolution <a id="temp.over">[[temp.over]]</a>
|
| 2 |
|
| 3 |
-
When a call
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
| 10 |
the argument deduction and checking succeeds, the *template-argument*s
|
| 11 |
(deduced and/or explicit) are used to synthesize the declaration of a
|
| 12 |
single function template specialization which is added to the candidate
|
| 13 |
functions set to be used in overload resolution. If, for a given
|
| 14 |
function template, argument deduction fails or the synthesized function
|
| 15 |
template specialization would be ill-formed, no such function is added
|
| 16 |
to the set of candidate functions for that template. The complete set of
|
| 17 |
candidate functions includes all the synthesized declarations and all of
|
| 18 |
-
the non-template
|
| 19 |
declarations are treated like any other functions in the remainder of
|
| 20 |
overload resolution, except as explicitly noted in
|
| 21 |
-
[[over.match.best]].[^
|
| 22 |
|
| 23 |
[*Example 1*:
|
| 24 |
|
| 25 |
``` cpp
|
| 26 |
template<class T> T max(T a, T b) { return a>b?a:b; }
|
|
@@ -37,11 +38,11 @@ Adding the non-template function
|
|
| 37 |
``` cpp
|
| 38 |
int max(int,int);
|
| 39 |
```
|
| 40 |
|
| 41 |
to the example above would resolve the third call, by providing a
|
| 42 |
-
function that
|
| 43 |
conversion of `char` to `int` for `c`.
|
| 44 |
|
| 45 |
— *end example*]
|
| 46 |
|
| 47 |
[*Example 2*:
|
|
@@ -91,46 +92,42 @@ a template specialization is a candidate.
|
|
| 91 |
|
| 92 |
``` cpp
|
| 93 |
template<class T> void f(T); // declaration
|
| 94 |
|
| 95 |
void g() {
|
| 96 |
-
f("Annemarie"); //
|
| 97 |
}
|
| 98 |
```
|
| 99 |
|
| 100 |
-
The call
|
| 101 |
and not defined at the point of the call. The program will be ill-formed
|
| 102 |
-
unless a specialization for `f<const char*>`
|
| 103 |
-
|
| 104 |
|
| 105 |
— *end example*]
|
| 106 |
|
| 107 |
<!-- Link reference definitions -->
|
| 108 |
[basic.def]: basic.md#basic.def
|
| 109 |
[basic.def.odr]: basic.md#basic.def.odr
|
| 110 |
[basic.link]: basic.md#basic.link
|
| 111 |
[basic.lookup]: basic.md#basic.lookup
|
| 112 |
[basic.lookup.argdep]: basic.md#basic.lookup.argdep
|
| 113 |
-
[basic.lookup.classref]: basic.md#basic.lookup.classref
|
| 114 |
[basic.lookup.qual]: basic.md#basic.lookup.qual
|
| 115 |
-
[basic.lookup.unqual]: basic.md#basic.lookup.unqual
|
| 116 |
-
[basic.scope]: basic.md#basic.scope
|
| 117 |
-
[basic.scope.hiding]: basic.md#basic.scope.hiding
|
| 118 |
[basic.scope.namespace]: basic.md#basic.scope.namespace
|
|
|
|
| 119 |
[basic.stc.dynamic.deallocation]: basic.md#basic.stc.dynamic.deallocation
|
| 120 |
[basic.types]: basic.md#basic.types
|
| 121 |
[class.access]: class.md#class.access
|
| 122 |
[class.base.init]: class.md#class.base.init
|
| 123 |
[class.conv.fct]: class.md#class.conv.fct
|
| 124 |
[class.ctor]: class.md#class.ctor
|
| 125 |
[class.default.ctor]: class.md#class.default.ctor
|
| 126 |
[class.derived]: class.md#class.derived
|
| 127 |
[class.dtor]: class.md#class.dtor
|
| 128 |
-
[class.friend]: class.md#class.friend
|
| 129 |
[class.local]: class.md#class.local
|
| 130 |
[class.mem]: class.md#class.mem
|
| 131 |
-
[class.member.lookup]:
|
| 132 |
[class.pre]: class.md#class.pre
|
| 133 |
[class.qual]: basic.md#class.qual
|
| 134 |
[class.temporary]: basic.md#class.temporary
|
| 135 |
[conv]: expr.md#conv
|
| 136 |
[conv.array]: expr.md#conv.array
|
|
@@ -139,11 +136,10 @@ explicitly generated, is present in some translation unit.
|
|
| 139 |
[conv.lval]: expr.md#conv.lval
|
| 140 |
[conv.qual]: expr.md#conv.qual
|
| 141 |
[dcl.align]: dcl.md#dcl.align
|
| 142 |
[dcl.attr.grammar]: dcl.md#dcl.attr.grammar
|
| 143 |
[dcl.decl]: dcl.md#dcl.decl
|
| 144 |
-
[dcl.enum]: dcl.md#dcl.enum
|
| 145 |
[dcl.fct]: dcl.md#dcl.fct
|
| 146 |
[dcl.fct.def.general]: dcl.md#dcl.fct.def.general
|
| 147 |
[dcl.fct.default]: dcl.md#dcl.fct.default
|
| 148 |
[dcl.init]: dcl.md#dcl.init
|
| 149 |
[dcl.init.list]: dcl.md#dcl.init.list
|
|
@@ -153,106 +149,119 @@ explicitly generated, is present in some translation unit.
|
|
| 153 |
[dcl.stc]: dcl.md#dcl.stc
|
| 154 |
[dcl.struct.bind]: dcl.md#dcl.struct.bind
|
| 155 |
[dcl.type.class.deduct]: dcl.md#dcl.type.class.deduct
|
| 156 |
[dcl.type.elab]: dcl.md#dcl.type.elab
|
| 157 |
[dcl.type.simple]: dcl.md#dcl.type.simple
|
|
|
|
| 158 |
[except.spec]: except.md#except.spec
|
| 159 |
[expr.const]: expr.md#expr.const
|
| 160 |
[expr.context]: expr.md#expr.context
|
| 161 |
[expr.log.and]: expr.md#expr.log.and
|
| 162 |
[expr.log.or]: expr.md#expr.log.or
|
| 163 |
[expr.new]: expr.md#expr.new
|
| 164 |
[expr.prim.fold]: expr.md#expr.prim.fold
|
| 165 |
[expr.prim.id]: expr.md#expr.prim.id
|
|
|
|
| 166 |
[expr.prim.id.unqual]: expr.md#expr.prim.id.unqual
|
| 167 |
[expr.prim.lambda.capture]: expr.md#expr.prim.lambda.capture
|
| 168 |
[expr.prim.lambda.closure]: expr.md#expr.prim.lambda.closure
|
|
|
|
| 169 |
[expr.ref]: expr.md#expr.ref
|
| 170 |
[expr.sizeof]: expr.md#expr.sizeof
|
|
|
|
| 171 |
[expr.typeid]: expr.md#expr.typeid
|
| 172 |
[expr.unary.op]: expr.md#expr.unary.op
|
| 173 |
[implimits]: limits.md#implimits
|
| 174 |
[intro.defs]: intro.md#intro.defs
|
| 175 |
[intro.object]: basic.md#intro.object
|
| 176 |
[lex.string]: lex.md#lex.string
|
| 177 |
-
[
|
| 178 |
-
[namespace.memdef]: dcl.md#namespace.memdef
|
| 179 |
[namespace.udecl]: dcl.md#namespace.udecl
|
| 180 |
-
[over.ics.rank]: over.md#over.ics.rank
|
| 181 |
[over.match]: over.md#over.match
|
| 182 |
[over.match.best]: over.md#over.match.best
|
| 183 |
[over.match.class.deduct]: over.md#over.match.class.deduct
|
| 184 |
-
[over.match.
|
| 185 |
[over.match.oper]: over.md#over.match.oper
|
| 186 |
-
[over.match.ref]: over.md#over.match.ref
|
| 187 |
[over.match.viable]: over.md#over.match.viable
|
| 188 |
[over.over]: over.md#over.over
|
| 189 |
[special]: class.md#special
|
| 190 |
[stmt.if]: stmt.md#stmt.if
|
| 191 |
[support.types]: support.md#support.types
|
| 192 |
[temp]: #temp
|
| 193 |
[temp.alias]: #temp.alias
|
| 194 |
[temp.arg]: #temp.arg
|
| 195 |
[temp.arg.explicit]: #temp.arg.explicit
|
|
|
|
| 196 |
[temp.arg.nontype]: #temp.arg.nontype
|
| 197 |
[temp.arg.template]: #temp.arg.template
|
| 198 |
[temp.arg.type]: #temp.arg.type
|
| 199 |
[temp.class]: #temp.class
|
| 200 |
-
[temp.class.
|
| 201 |
-
[temp.class.spec]: #temp.class.spec
|
| 202 |
-
[temp.class.spec.match]: #temp.class.spec.match
|
| 203 |
-
[temp.class.spec.mfunc]: #temp.class.spec.mfunc
|
| 204 |
[temp.concept]: #temp.concept
|
| 205 |
[temp.constr]: #temp.constr
|
| 206 |
[temp.constr.atomic]: #temp.constr.atomic
|
| 207 |
[temp.constr.constr]: #temp.constr.constr
|
|
|
|
| 208 |
[temp.constr.decl]: #temp.constr.decl
|
|
|
|
| 209 |
[temp.constr.normal]: #temp.constr.normal
|
| 210 |
[temp.constr.op]: #temp.constr.op
|
| 211 |
[temp.constr.order]: #temp.constr.order
|
| 212 |
[temp.decls]: #temp.decls
|
|
|
|
| 213 |
[temp.deduct]: #temp.deduct
|
| 214 |
[temp.deduct.call]: #temp.deduct.call
|
| 215 |
[temp.deduct.conv]: #temp.deduct.conv
|
| 216 |
[temp.deduct.decl]: #temp.deduct.decl
|
| 217 |
[temp.deduct.funcaddr]: #temp.deduct.funcaddr
|
|
|
|
| 218 |
[temp.deduct.guide]: #temp.deduct.guide
|
| 219 |
[temp.deduct.partial]: #temp.deduct.partial
|
| 220 |
[temp.deduct.type]: #temp.deduct.type
|
| 221 |
[temp.dep]: #temp.dep
|
| 222 |
[temp.dep.candidate]: #temp.dep.candidate
|
| 223 |
[temp.dep.constexpr]: #temp.dep.constexpr
|
| 224 |
[temp.dep.expr]: #temp.dep.expr
|
|
|
|
| 225 |
[temp.dep.res]: #temp.dep.res
|
| 226 |
[temp.dep.temp]: #temp.dep.temp
|
| 227 |
[temp.dep.type]: #temp.dep.type
|
| 228 |
[temp.expl.spec]: #temp.expl.spec
|
| 229 |
[temp.explicit]: #temp.explicit
|
| 230 |
[temp.fct]: #temp.fct
|
|
|
|
| 231 |
[temp.fct.spec]: #temp.fct.spec
|
|
|
|
| 232 |
[temp.fold.empty]: #temp.fold.empty
|
| 233 |
[temp.friend]: #temp.friend
|
| 234 |
[temp.func.order]: #temp.func.order
|
| 235 |
-
[temp.inject]: #temp.inject
|
| 236 |
[temp.inst]: #temp.inst
|
| 237 |
[temp.local]: #temp.local
|
| 238 |
[temp.mem]: #temp.mem
|
| 239 |
[temp.mem.class]: #temp.mem.class
|
| 240 |
[temp.mem.enum]: #temp.mem.enum
|
| 241 |
[temp.mem.func]: #temp.mem.func
|
| 242 |
[temp.names]: #temp.names
|
| 243 |
-
[temp.nondep]: #temp.nondep
|
| 244 |
[temp.over]: #temp.over
|
| 245 |
[temp.over.link]: #temp.over.link
|
| 246 |
[temp.param]: #temp.param
|
| 247 |
[temp.point]: #temp.point
|
| 248 |
[temp.pre]: #temp.pre
|
| 249 |
[temp.res]: #temp.res
|
|
|
|
| 250 |
[temp.spec]: #temp.spec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 251 |
[temp.static]: #temp.static
|
| 252 |
[temp.type]: #temp.type
|
| 253 |
[temp.variadic]: #temp.variadic
|
|
|
|
|
|
|
| 254 |
|
| 255 |
[^1]: Since template *template-parameter*s and template
|
| 256 |
*template-argument*s are treated as types for descriptive purposes,
|
| 257 |
the terms *non-type parameter* and *non-type argument* are used to
|
| 258 |
refer to non-type, non-template parameters and arguments.
|
|
@@ -266,51 +275,50 @@ explicitly generated, is present in some translation unit.
|
|
| 266 |
because the form of the *template-parameter* determines the
|
| 267 |
allowable forms of the *template-argument*.
|
| 268 |
|
| 269 |
[^4]: A constraint is in disjunctive normal form when it is a
|
| 270 |
disjunction of clauses where each clause is a conjunction of atomic
|
| 271 |
-
constraints.
|
| 272 |
-
|
| 273 |
-
\[*Example 5*: For atomic constraints A, B, and C, the disjunctive
|
| 274 |
normal form of the constraint A ∧ (B ∨ C) is (A ∧ B) ∨ (A ∧ C). Its
|
| 275 |
-
disjunctive clauses are (A ∧ B) and (A ∧ C).
|
| 276 |
|
| 277 |
[^5]: A constraint is in conjunctive normal form when it is a
|
| 278 |
conjunction of clauses where each clause is a disjunction of atomic
|
| 279 |
-
constraints.
|
| 280 |
-
|
| 281 |
-
\[*Example 6*: For atomic constraints A, B, and C, the constraint
|
| 282 |
A ∧ (B ∨ C) is in conjunctive normal form. Its conjunctive clauses
|
| 283 |
-
are A and (B ∨ C).
|
| 284 |
|
| 285 |
[^6]: The identity of enumerators is not preserved.
|
| 286 |
|
| 287 |
[^7]: An array as a *template-parameter* decays to a pointer.
|
| 288 |
|
| 289 |
-
[^8]: There is no
|
| 290 |
|
| 291 |
[^9]: That is, declarations of non-template functions do not merely
|
| 292 |
guide overload resolution of function template specializations with
|
| 293 |
the same name. If such a non-template function is odr-used
|
| 294 |
-
[[
|
| 295 |
implicitly instantiated using the function template definition.
|
| 296 |
|
| 297 |
[^10]: This includes friend function declarations.
|
| 298 |
|
| 299 |
-
[^11]:
|
| 300 |
-
|
| 301 |
|
| 302 |
-
[^12]:
|
|
|
|
|
|
|
|
|
|
| 303 |
context; they only become arguments after a function has been
|
| 304 |
selected.
|
| 305 |
|
| 306 |
-
[^
|
| 307 |
-
*template-parameter* of type `bool`
|
| 308 |
bound, the resulting value will always be `true` because the array
|
| 309 |
bound will be nonzero.
|
| 310 |
|
| 311 |
-
[^
|
| 312 |
template parameter types. The set of conversions allowed on deduced
|
| 313 |
arguments is limited, because the argument deduction process
|
| 314 |
produces function templates with parameters that either match the
|
| 315 |
call arguments exactly or differ only in ways that can be bridged by
|
| 316 |
the allowed limited conversions. Non-deduced arguments allow the
|
|
|
|
| 1 |
### Overload resolution <a id="temp.over">[[temp.over]]</a>
|
| 2 |
|
| 3 |
+
When a call of a function or function template is written (explicitly,
|
| 4 |
+
or implicitly using the operator notation), template argument deduction
|
| 5 |
+
[[temp.deduct]] and checking of any explicit template arguments
|
| 6 |
+
[[temp.arg]] are performed for each function template to find the
|
| 7 |
+
template argument values (if any) that can be used with that function
|
| 8 |
+
template to instantiate a function template specialization that can be
|
| 9 |
+
invoked with the call arguments or, for conversion function templates,
|
| 10 |
+
that can convert to the required type. For each function template, if
|
| 11 |
the argument deduction and checking succeeds, the *template-argument*s
|
| 12 |
(deduced and/or explicit) are used to synthesize the declaration of a
|
| 13 |
single function template specialization which is added to the candidate
|
| 14 |
functions set to be used in overload resolution. If, for a given
|
| 15 |
function template, argument deduction fails or the synthesized function
|
| 16 |
template specialization would be ill-formed, no such function is added
|
| 17 |
to the set of candidate functions for that template. The complete set of
|
| 18 |
candidate functions includes all the synthesized declarations and all of
|
| 19 |
+
the non-template functions found by name lookup. The synthesized
|
| 20 |
declarations are treated like any other functions in the remainder of
|
| 21 |
overload resolution, except as explicitly noted in
|
| 22 |
+
[[over.match.best]].[^15]
|
| 23 |
|
| 24 |
[*Example 1*:
|
| 25 |
|
| 26 |
``` cpp
|
| 27 |
template<class T> T max(T a, T b) { return a>b?a:b; }
|
|
|
|
| 38 |
``` cpp
|
| 39 |
int max(int,int);
|
| 40 |
```
|
| 41 |
|
| 42 |
to the example above would resolve the third call, by providing a
|
| 43 |
+
function that can be called for `max(a,c)` after using the standard
|
| 44 |
conversion of `char` to `int` for `c`.
|
| 45 |
|
| 46 |
— *end example*]
|
| 47 |
|
| 48 |
[*Example 2*:
|
|
|
|
| 92 |
|
| 93 |
``` cpp
|
| 94 |
template<class T> void f(T); // declaration
|
| 95 |
|
| 96 |
void g() {
|
| 97 |
+
f("Annemarie"); // calls f<const char*>
|
| 98 |
}
|
| 99 |
```
|
| 100 |
|
| 101 |
+
The call to `f` is well-formed even if the template `f` is only declared
|
| 102 |
and not defined at the point of the call. The program will be ill-formed
|
| 103 |
+
unless a specialization for `f<const char*>` is explicitly instantiated
|
| 104 |
+
in some translation unit [[temp.pre]].
|
| 105 |
|
| 106 |
— *end example*]
|
| 107 |
|
| 108 |
<!-- Link reference definitions -->
|
| 109 |
[basic.def]: basic.md#basic.def
|
| 110 |
[basic.def.odr]: basic.md#basic.def.odr
|
| 111 |
[basic.link]: basic.md#basic.link
|
| 112 |
[basic.lookup]: basic.md#basic.lookup
|
| 113 |
[basic.lookup.argdep]: basic.md#basic.lookup.argdep
|
|
|
|
| 114 |
[basic.lookup.qual]: basic.md#basic.lookup.qual
|
|
|
|
|
|
|
|
|
|
| 115 |
[basic.scope.namespace]: basic.md#basic.scope.namespace
|
| 116 |
+
[basic.scope.scope]: basic.md#basic.scope.scope
|
| 117 |
[basic.stc.dynamic.deallocation]: basic.md#basic.stc.dynamic.deallocation
|
| 118 |
[basic.types]: basic.md#basic.types
|
| 119 |
[class.access]: class.md#class.access
|
| 120 |
[class.base.init]: class.md#class.base.init
|
| 121 |
[class.conv.fct]: class.md#class.conv.fct
|
| 122 |
[class.ctor]: class.md#class.ctor
|
| 123 |
[class.default.ctor]: class.md#class.default.ctor
|
| 124 |
[class.derived]: class.md#class.derived
|
| 125 |
[class.dtor]: class.md#class.dtor
|
|
|
|
| 126 |
[class.local]: class.md#class.local
|
| 127 |
[class.mem]: class.md#class.mem
|
| 128 |
+
[class.member.lookup]: basic.md#class.member.lookup
|
| 129 |
[class.pre]: class.md#class.pre
|
| 130 |
[class.qual]: basic.md#class.qual
|
| 131 |
[class.temporary]: basic.md#class.temporary
|
| 132 |
[conv]: expr.md#conv
|
| 133 |
[conv.array]: expr.md#conv.array
|
|
|
|
| 136 |
[conv.lval]: expr.md#conv.lval
|
| 137 |
[conv.qual]: expr.md#conv.qual
|
| 138 |
[dcl.align]: dcl.md#dcl.align
|
| 139 |
[dcl.attr.grammar]: dcl.md#dcl.attr.grammar
|
| 140 |
[dcl.decl]: dcl.md#dcl.decl
|
|
|
|
| 141 |
[dcl.fct]: dcl.md#dcl.fct
|
| 142 |
[dcl.fct.def.general]: dcl.md#dcl.fct.def.general
|
| 143 |
[dcl.fct.default]: dcl.md#dcl.fct.default
|
| 144 |
[dcl.init]: dcl.md#dcl.init
|
| 145 |
[dcl.init.list]: dcl.md#dcl.init.list
|
|
|
|
| 149 |
[dcl.stc]: dcl.md#dcl.stc
|
| 150 |
[dcl.struct.bind]: dcl.md#dcl.struct.bind
|
| 151 |
[dcl.type.class.deduct]: dcl.md#dcl.type.class.deduct
|
| 152 |
[dcl.type.elab]: dcl.md#dcl.type.elab
|
| 153 |
[dcl.type.simple]: dcl.md#dcl.type.simple
|
| 154 |
+
[depr.template.template]: future.md#depr.template.template
|
| 155 |
[except.spec]: except.md#except.spec
|
| 156 |
[expr.const]: expr.md#expr.const
|
| 157 |
[expr.context]: expr.md#expr.context
|
| 158 |
[expr.log.and]: expr.md#expr.log.and
|
| 159 |
[expr.log.or]: expr.md#expr.log.or
|
| 160 |
[expr.new]: expr.md#expr.new
|
| 161 |
[expr.prim.fold]: expr.md#expr.prim.fold
|
| 162 |
[expr.prim.id]: expr.md#expr.prim.id
|
| 163 |
+
[expr.prim.id.qual]: expr.md#expr.prim.id.qual
|
| 164 |
[expr.prim.id.unqual]: expr.md#expr.prim.id.unqual
|
| 165 |
[expr.prim.lambda.capture]: expr.md#expr.prim.lambda.capture
|
| 166 |
[expr.prim.lambda.closure]: expr.md#expr.prim.lambda.closure
|
| 167 |
+
[expr.prim.this]: expr.md#expr.prim.this
|
| 168 |
[expr.ref]: expr.md#expr.ref
|
| 169 |
[expr.sizeof]: expr.md#expr.sizeof
|
| 170 |
+
[expr.type.conv]: expr.md#expr.type.conv
|
| 171 |
[expr.typeid]: expr.md#expr.typeid
|
| 172 |
[expr.unary.op]: expr.md#expr.unary.op
|
| 173 |
[implimits]: limits.md#implimits
|
| 174 |
[intro.defs]: intro.md#intro.defs
|
| 175 |
[intro.object]: basic.md#intro.object
|
| 176 |
[lex.string]: lex.md#lex.string
|
| 177 |
+
[module.unit]: module.md#module.unit
|
|
|
|
| 178 |
[namespace.udecl]: dcl.md#namespace.udecl
|
|
|
|
| 179 |
[over.match]: over.md#over.match
|
| 180 |
[over.match.best]: over.md#over.match.best
|
| 181 |
[over.match.class.deduct]: over.md#over.match.class.deduct
|
| 182 |
+
[over.match.funcs]: over.md#over.match.funcs
|
| 183 |
[over.match.oper]: over.md#over.match.oper
|
|
|
|
| 184 |
[over.match.viable]: over.md#over.match.viable
|
| 185 |
[over.over]: over.md#over.over
|
| 186 |
[special]: class.md#special
|
| 187 |
[stmt.if]: stmt.md#stmt.if
|
| 188 |
[support.types]: support.md#support.types
|
| 189 |
[temp]: #temp
|
| 190 |
[temp.alias]: #temp.alias
|
| 191 |
[temp.arg]: #temp.arg
|
| 192 |
[temp.arg.explicit]: #temp.arg.explicit
|
| 193 |
+
[temp.arg.general]: #temp.arg.general
|
| 194 |
[temp.arg.nontype]: #temp.arg.nontype
|
| 195 |
[temp.arg.template]: #temp.arg.template
|
| 196 |
[temp.arg.type]: #temp.arg.type
|
| 197 |
[temp.class]: #temp.class
|
| 198 |
+
[temp.class.general]: #temp.class.general
|
|
|
|
|
|
|
|
|
|
| 199 |
[temp.concept]: #temp.concept
|
| 200 |
[temp.constr]: #temp.constr
|
| 201 |
[temp.constr.atomic]: #temp.constr.atomic
|
| 202 |
[temp.constr.constr]: #temp.constr.constr
|
| 203 |
+
[temp.constr.constr.general]: #temp.constr.constr.general
|
| 204 |
[temp.constr.decl]: #temp.constr.decl
|
| 205 |
+
[temp.constr.general]: #temp.constr.general
|
| 206 |
[temp.constr.normal]: #temp.constr.normal
|
| 207 |
[temp.constr.op]: #temp.constr.op
|
| 208 |
[temp.constr.order]: #temp.constr.order
|
| 209 |
[temp.decls]: #temp.decls
|
| 210 |
+
[temp.decls.general]: #temp.decls.general
|
| 211 |
[temp.deduct]: #temp.deduct
|
| 212 |
[temp.deduct.call]: #temp.deduct.call
|
| 213 |
[temp.deduct.conv]: #temp.deduct.conv
|
| 214 |
[temp.deduct.decl]: #temp.deduct.decl
|
| 215 |
[temp.deduct.funcaddr]: #temp.deduct.funcaddr
|
| 216 |
+
[temp.deduct.general]: #temp.deduct.general
|
| 217 |
[temp.deduct.guide]: #temp.deduct.guide
|
| 218 |
[temp.deduct.partial]: #temp.deduct.partial
|
| 219 |
[temp.deduct.type]: #temp.deduct.type
|
| 220 |
[temp.dep]: #temp.dep
|
| 221 |
[temp.dep.candidate]: #temp.dep.candidate
|
| 222 |
[temp.dep.constexpr]: #temp.dep.constexpr
|
| 223 |
[temp.dep.expr]: #temp.dep.expr
|
| 224 |
+
[temp.dep.general]: #temp.dep.general
|
| 225 |
[temp.dep.res]: #temp.dep.res
|
| 226 |
[temp.dep.temp]: #temp.dep.temp
|
| 227 |
[temp.dep.type]: #temp.dep.type
|
| 228 |
[temp.expl.spec]: #temp.expl.spec
|
| 229 |
[temp.explicit]: #temp.explicit
|
| 230 |
[temp.fct]: #temp.fct
|
| 231 |
+
[temp.fct.general]: #temp.fct.general
|
| 232 |
[temp.fct.spec]: #temp.fct.spec
|
| 233 |
+
[temp.fct.spec.general]: #temp.fct.spec.general
|
| 234 |
[temp.fold.empty]: #temp.fold.empty
|
| 235 |
[temp.friend]: #temp.friend
|
| 236 |
[temp.func.order]: #temp.func.order
|
|
|
|
| 237 |
[temp.inst]: #temp.inst
|
| 238 |
[temp.local]: #temp.local
|
| 239 |
[temp.mem]: #temp.mem
|
| 240 |
[temp.mem.class]: #temp.mem.class
|
| 241 |
[temp.mem.enum]: #temp.mem.enum
|
| 242 |
[temp.mem.func]: #temp.mem.func
|
| 243 |
[temp.names]: #temp.names
|
|
|
|
| 244 |
[temp.over]: #temp.over
|
| 245 |
[temp.over.link]: #temp.over.link
|
| 246 |
[temp.param]: #temp.param
|
| 247 |
[temp.point]: #temp.point
|
| 248 |
[temp.pre]: #temp.pre
|
| 249 |
[temp.res]: #temp.res
|
| 250 |
+
[temp.res.general]: #temp.res.general
|
| 251 |
[temp.spec]: #temp.spec
|
| 252 |
+
[temp.spec.general]: #temp.spec.general
|
| 253 |
+
[temp.spec.partial]: #temp.spec.partial
|
| 254 |
+
[temp.spec.partial.general]: #temp.spec.partial.general
|
| 255 |
+
[temp.spec.partial.match]: #temp.spec.partial.match
|
| 256 |
+
[temp.spec.partial.member]: #temp.spec.partial.member
|
| 257 |
+
[temp.spec.partial.order]: #temp.spec.partial.order
|
| 258 |
[temp.static]: #temp.static
|
| 259 |
[temp.type]: #temp.type
|
| 260 |
[temp.variadic]: #temp.variadic
|
| 261 |
+
[term.incomplete.type]: basic.md#term.incomplete.type
|
| 262 |
+
[term.odr.use]: basic.md#term.odr.use
|
| 263 |
|
| 264 |
[^1]: Since template *template-parameter*s and template
|
| 265 |
*template-argument*s are treated as types for descriptive purposes,
|
| 266 |
the terms *non-type parameter* and *non-type argument* are used to
|
| 267 |
refer to non-type, non-template parameters and arguments.
|
|
|
|
| 275 |
because the form of the *template-parameter* determines the
|
| 276 |
allowable forms of the *template-argument*.
|
| 277 |
|
| 278 |
[^4]: A constraint is in disjunctive normal form when it is a
|
| 279 |
disjunction of clauses where each clause is a conjunction of atomic
|
| 280 |
+
constraints. For atomic constraints A, B, and C, the disjunctive
|
|
|
|
|
|
|
| 281 |
normal form of the constraint A ∧ (B ∨ C) is (A ∧ B) ∨ (A ∧ C). Its
|
| 282 |
+
disjunctive clauses are (A ∧ B) and (A ∧ C).
|
| 283 |
|
| 284 |
[^5]: A constraint is in conjunctive normal form when it is a
|
| 285 |
conjunction of clauses where each clause is a disjunction of atomic
|
| 286 |
+
constraints. For atomic constraints A, B, and C, the constraint
|
|
|
|
|
|
|
| 287 |
A ∧ (B ∨ C) is in conjunctive normal form. Its conjunctive clauses
|
| 288 |
+
are A and (B ∨ C).
|
| 289 |
|
| 290 |
[^6]: The identity of enumerators is not preserved.
|
| 291 |
|
| 292 |
[^7]: An array as a *template-parameter* decays to a pointer.
|
| 293 |
|
| 294 |
+
[^8]: There is no context in which they would be used.
|
| 295 |
|
| 296 |
[^9]: That is, declarations of non-template functions do not merely
|
| 297 |
guide overload resolution of function template specializations with
|
| 298 |
the same name. If such a non-template function is odr-used
|
| 299 |
+
[[term.odr.use]] in a program, it must be defined; it will not be
|
| 300 |
implicitly instantiated using the function template definition.
|
| 301 |
|
| 302 |
[^10]: This includes friend function declarations.
|
| 303 |
|
| 304 |
+
[^11]: Every instantiation of a class template declares a different set
|
| 305 |
+
of assignment operators.
|
| 306 |
|
| 307 |
+
[^12]: This includes an injected-class-name [[class.pre]] of a class
|
| 308 |
+
template used without a *template-argument-list*.
|
| 309 |
+
|
| 310 |
+
[^13]: Default arguments are not considered to be arguments in this
|
| 311 |
context; they only become arguments after a function has been
|
| 312 |
selected.
|
| 313 |
|
| 314 |
+
[^14]: Although the *template-argument* corresponding to a
|
| 315 |
+
*template-parameter* of type `bool` can be deduced from an array
|
| 316 |
bound, the resulting value will always be `true` because the array
|
| 317 |
bound will be nonzero.
|
| 318 |
|
| 319 |
+
[^15]: The parameters of function template specializations contain no
|
| 320 |
template parameter types. The set of conversions allowed on deduced
|
| 321 |
arguments is limited, because the argument deduction process
|
| 322 |
produces function templates with parameters that either match the
|
| 323 |
call arguments exactly or differ only in ways that can be bridged by
|
| 324 |
the allowed limited conversions. Non-deduced arguments allow the
|