From Jason Turner

[temp.pre]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp5e8xgu9k/{from.md → to.md} +34 -33
tmp/tmp5e8xgu9k/{from.md → to.md} RENAMED
@@ -36,11 +36,11 @@ constraint-logical-and-expression:
36
  primary-expression
37
  constraint-logical-and-expression '&&' primary-expression
38
  ```
39
 
40
  [*Note 1*: The `>` token following the *template-parameter-list* of a
41
- *template-declaration* may be the product of replacing a `>{>}` token by
42
  two consecutive `>` tokens [[temp.names]]. — *end note*]
43
 
44
  The *declaration* in a *template-declaration* (if any) shall
45
 
46
  - declare or define a function, a class, or a variable, or
@@ -76,49 +76,44 @@ struct matrix_constants {
76
  };
77
  ```
78
 
79
  — *end example*]
80
 
81
- A *template-declaration* can appear only as a namespace scope or class
82
- scope declaration. Its *declaration* shall not be an
83
- *export-declaration*. In a function template declaration, the last
84
- component of the *declarator-id* shall not be a *template-id*.
85
 
86
- [*Note 2*: That last component may be an *identifier*, an
87
- *operator-function-id*, a *conversion-function-id*, or a
88
- *literal-operator-id*. In a class template declaration, if the class
89
- name is a *simple-template-id*, the declaration declares a class
90
- template partial specialization [[temp.class.spec]]. *end note*]
 
 
91
 
92
  In a *template-declaration*, explicit specialization, or explicit
93
  instantiation the *init-declarator-list* in the declaration shall
94
  contain at most one declarator. When such a declaration is used to
95
  declare a class template, no declarator is permitted.
96
 
97
- A template name has linkage [[basic.link]]. Specializations (explicit or
98
- implicit) of a template that has internal linkage are distinct from all
99
- specializations in other translation units. A template, a template
100
- explicit specialization [[temp.expl.spec]], and a class template partial
101
- specialization shall not have C linkage. Use of a linkage specification
102
- other than `"C"` or `"C++"` with any of these constructs is
103
- conditionally-supported, with *implementation-defined* semantics.
104
- Template definitions shall obey the one-definition rule
105
- [[basic.def.odr]].
106
 
107
- [*Note 3*: Default arguments for function templates and for member
108
  functions of class templates are considered definitions for the purpose
109
- of template instantiation [[temp.decls]] and must also obey the
110
- one-definition rule. — *end note*]
111
 
112
- A class template shall not have the same name as any other template,
113
- class, function, variable, enumeration, enumerator, namespace, or type
114
- in the same scope [[basic.scope]], except as specified in 
115
- [[temp.class.spec]]. Except that a function template can be overloaded
116
- either by non-template functions [[dcl.fct]] with the same name or by
117
- other function templates with the same name [[temp.over]], a template
118
- name declared in namespace scope or in class scope shall be unique in
119
- that scope.
120
 
121
  An entity is *templated* if it is
122
 
123
  - a template,
124
  - an entity defined [[basic.def]] or created [[class.temporary]] in a
@@ -126,23 +121,29 @@ An entity is *templated* if it is
126
  - a member of a templated entity,
127
  - an enumerator for an enumeration that is a templated entity, or
128
  - the closure type of a *lambda-expression* [[expr.prim.lambda.closure]]
129
  appearing in the declaration of a templated entity.
130
 
131
- [*Note 4*: A local class, a local variable, or a friend function
132
- defined in a templated entity is a templated entity. — *end note*]
 
 
 
 
 
 
133
 
134
  A *template-declaration* is written in terms of its template parameters.
135
  The optional *requires-clause* following a *template-parameter-list*
136
  allows the specification of constraints [[temp.constr.decl]] on template
137
  arguments [[temp.arg]]. The *requires-clause* introduces the
138
  *constraint-expression* that results from interpreting the
139
  *constraint-logical-or-expression* as a *constraint-expression*. The
140
  *constraint-logical-or-expression* of a *requires-clause* is an
141
  unevaluated operand [[expr.context]].
142
 
143
- [*Note 5*:
144
 
145
  The expression in a *requires-clause* uses a restricted grammar to avoid
146
  ambiguities. Parentheses can be used to specify arbitrary expressions in
147
  a *requires-clause*.
148
 
 
36
  primary-expression
37
  constraint-logical-and-expression '&&' primary-expression
38
  ```
39
 
40
  [*Note 1*: The `>` token following the *template-parameter-list* of a
41
+ *template-declaration* can be the product of replacing a `>>` token by
42
  two consecutive `>` tokens [[temp.names]]. — *end note*]
43
 
44
  The *declaration* in a *template-declaration* (if any) shall
45
 
46
  - declare or define a function, a class, or a variable, or
 
76
  };
77
  ```
78
 
79
  — *end example*]
80
 
81
+ [*Note 2*: A *template-declaration* can appear only as a namespace
82
+ scope or class scope declaration. *end note*]
 
 
83
 
84
+ Its *declaration* shall not be an *export-declaration*. In a function
85
+ template declaration, the *unqualified-id* of the *declarator-id* shall
86
+ be a name.
87
+
88
+ [*Note 3*: A class or variable template declaration of a
89
+ *simple-template-id* declares a partial specialization
90
+ [[temp.spec.partial]]. — *end note*]
91
 
92
  In a *template-declaration*, explicit specialization, or explicit
93
  instantiation the *init-declarator-list* in the declaration shall
94
  contain at most one declarator. When such a declaration is used to
95
  declare a class template, no declarator is permitted.
96
 
97
+ A specialization (explicit or implicit) of one template is distinct from
98
+ all specializations of any other template. A template, an explicit
99
+ specialization [[temp.expl.spec]], and a partial specialization shall
100
+ not have C language linkage.
 
 
 
 
 
101
 
102
+ [*Note 4*: Default arguments for function templates and for member
103
  functions of class templates are considered definitions for the purpose
104
+ of template instantiation [[temp.decls]] and must obey the
105
+ one-definition rule [[basic.def.odr]]. — *end note*]
106
 
107
+ [*Note 5*: A template cannot have the same name as any other name bound
108
+ in the same scope [[basic.scope.scope]], except that a function template
109
+ can share a name with non-template functions [[dcl.fct]] and/or function
110
+ templates [[temp.over]]. Specializations, including partial
111
+ specializations [[temp.spec.partial]], do not reintroduce or bind names.
112
+ Their target scope is the target scope of the primary template, so all
113
+ specializations of a template belong to the same scope as it
114
+ does. — *end note*]
115
 
116
  An entity is *templated* if it is
117
 
118
  - a template,
119
  - an entity defined [[basic.def]] or created [[class.temporary]] in a
 
121
  - a member of a templated entity,
122
  - an enumerator for an enumeration that is a templated entity, or
123
  - the closure type of a *lambda-expression* [[expr.prim.lambda.closure]]
124
  appearing in the declaration of a templated entity.
125
 
126
+ [*Note 6*: A local class, a local or block variable, or a friend
127
+ function defined in a templated entity is a templated
128
+ entity. — *end note*]
129
+
130
+ A *templated function* is a function template or a function that is
131
+ templated. A *templated class* is a class template or a class that is
132
+ templated. A *templated variable* is a variable template or a variable
133
+ that is templated.
134
 
135
  A *template-declaration* is written in terms of its template parameters.
136
  The optional *requires-clause* following a *template-parameter-list*
137
  allows the specification of constraints [[temp.constr.decl]] on template
138
  arguments [[temp.arg]]. The *requires-clause* introduces the
139
  *constraint-expression* that results from interpreting the
140
  *constraint-logical-or-expression* as a *constraint-expression*. The
141
  *constraint-logical-or-expression* of a *requires-clause* is an
142
  unevaluated operand [[expr.context]].
143
 
144
+ [*Note 7*:
145
 
146
  The expression in a *requires-clause* uses a restricted grammar to avoid
147
  ambiguities. Parentheses can be used to specify arbitrary expressions in
148
  a *requires-clause*.
149