36 lines
1.4 KiB
Markdown
36 lines
1.4 KiB
Markdown
[temp.deduct.funcaddr]
|
||
|
||
# 13 Templates [[temp]](./#temp)
|
||
|
||
## 13.10 Function template specializations [[temp.fct.spec]](temp.fct.spec#temp.deduct.funcaddr)
|
||
|
||
### 13.10.3 Template argument deduction [[temp.deduct]](temp.deduct#funcaddr)
|
||
|
||
#### 13.10.3.3 Deducing template arguments taking the address of a function template [temp.deduct.funcaddr]
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/templates.tex#L8473)
|
||
|
||
Template arguments can be deduced from the type specified when taking
|
||
the address of an [overload set](over.over "12.3 Address of an overload set [over.over]")[.](#1.sentence-1)
|
||
|
||
If there is a target,
|
||
the function template's function type and the target type
|
||
are used as the types ofP andA,
|
||
and the deduction is done as
|
||
described in [[temp.deduct.type]](temp.deduct.type "13.10.3.6 Deducing template arguments from a type")[.](#1.sentence-2)
|
||
|
||
Otherwise, deduction is performed with empty sets of types P and A[.](#1.sentence-3)
|
||
|
||
[2](#2)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/templates.tex#L8486)
|
||
|
||
A placeholder type ([[dcl.spec.auto]](dcl.spec.auto "9.2.9.7 Placeholder type specifiers")) in the return type of a
|
||
function template is a non-deduced context[.](#2.sentence-1)
|
||
|
||
If template argument
|
||
deduction succeeds for such a function, the return type is determined
|
||
from instantiation of the function body[.](#2.sentence-2)
|