From Jason Turner

[temp.arg.explicit]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpnvl_5d1t/{from.md → to.md} +13 -15
tmp/tmpnvl_5d1t/{from.md → to.md} RENAMED
@@ -28,12 +28,11 @@ void g(double d) {
28
  ```
29
 
30
  — *end example*]
31
 
32
  Template arguments shall not be specified when referring to a
33
- specialization of a constructor template ([[class.ctor]],
34
- [[class.qual]]).
35
 
36
  A template argument list may be specified when referring to a
37
  specialization of a function template
38
 
39
  - when a function is called,
@@ -43,20 +42,19 @@ specialization of a function template
43
  - in an explicit instantiation, or
44
  - in a friend declaration.
45
 
46
  Trailing template arguments that can be deduced [[temp.deduct]] or
47
  obtained from default *template-argument*s may be omitted from the list
48
- of explicit *template-argument*s. A trailing template parameter pack
49
- [[temp.variadic]] not otherwise deduced will be deduced as an empty
50
- sequence of template arguments. If all of the template arguments can be
51
- deduced, they may all be omitted; in this case, the empty template
52
- argument list `<>` itself may also be omitted. In contexts where
53
- deduction is done and fails, or in contexts where deduction is not done,
54
- if a template argument list is specified and it, along with any default
55
- template arguments, identifies a single function template
56
- specialization, then the *template-id* is an lvalue for the function
57
- template specialization.
58
 
59
  [*Example 2*:
60
 
61
  ``` cpp
62
  template<class X, class Y> X f(Y);
@@ -72,11 +70,11 @@ void h() {
72
  }
73
  ```
74
 
75
  — *end example*]
76
 
77
- [*Note 1*:
78
 
79
  An empty template argument list can be used to indicate that a given use
80
  refers to a specialization of a function template even when a
81
  non-template function [[dcl.fct]] is visible that would otherwise be
82
  used. For example:
@@ -115,11 +113,11 @@ void g() {
115
  Implicit conversions [[conv]] will be performed on a function argument
116
  to convert it to the type of the corresponding function parameter if the
117
  parameter type contains no *template-parameter*s that participate in
118
  template argument deduction.
119
 
120
- [*Note 2*:
121
 
122
  Template parameters do not participate in template argument deduction if
123
  they are explicitly specified. For example,
124
 
125
  ``` cpp
@@ -134,11 +132,11 @@ void g() {
134
  }
135
  ```
136
 
137
  — *end note*]
138
 
139
- [*Note 3*: Because the explicit template argument list follows the
140
  function template name, and because constructor templates [[class.ctor]]
141
  are named without using a function name [[class.qual]], there is no way
142
  to provide an explicit template argument list for these function
143
  templates. — *end note*]
144
 
 
28
  ```
29
 
30
  — *end example*]
31
 
32
  Template arguments shall not be specified when referring to a
33
+ specialization of a constructor template [[class.ctor]], [[class.qual]].
 
34
 
35
  A template argument list may be specified when referring to a
36
  specialization of a function template
37
 
38
  - when a function is called,
 
42
  - in an explicit instantiation, or
43
  - in a friend declaration.
44
 
45
  Trailing template arguments that can be deduced [[temp.deduct]] or
46
  obtained from default *template-argument*s may be omitted from the list
47
+ of explicit *template-argument*s.
48
+
49
+ [*Note 1*: A trailing template parameter pack [[temp.variadic]] not
50
+ otherwise deduced will be deduced as an empty sequence of template
51
+ arguments. *end note*]
52
+
53
+ If all of the template arguments can be deduced or obtained from default
54
+ *template-argument*s, they may all be omitted; in this case, the empty
55
+ template argument list `<>` itself may also be omitted.
 
56
 
57
  [*Example 2*:
58
 
59
  ``` cpp
60
  template<class X, class Y> X f(Y);
 
70
  }
71
  ```
72
 
73
  — *end example*]
74
 
75
+ [*Note 2*:
76
 
77
  An empty template argument list can be used to indicate that a given use
78
  refers to a specialization of a function template even when a
79
  non-template function [[dcl.fct]] is visible that would otherwise be
80
  used. For example:
 
113
  Implicit conversions [[conv]] will be performed on a function argument
114
  to convert it to the type of the corresponding function parameter if the
115
  parameter type contains no *template-parameter*s that participate in
116
  template argument deduction.
117
 
118
+ [*Note 3*:
119
 
120
  Template parameters do not participate in template argument deduction if
121
  they are explicitly specified. For example,
122
 
123
  ``` cpp
 
132
  }
133
  ```
134
 
135
  — *end note*]
136
 
137
+ [*Note 4*: Because the explicit template argument list follows the
138
  function template name, and because constructor templates [[class.ctor]]
139
  are named without using a function name [[class.qual]], there is no way
140
  to provide an explicit template argument list for these function
141
  templates. — *end note*]
142