File tree 1 file changed +16
-2
lines changed
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 143
143
\begin {note }
144
144
A template cannot have the same name as any other
145
145
name bound in the same scope\iref {basic.scope.scope }, except
146
- that a function template can share a name with non-template
147
- functions\iref {dcl.fct } and/or function templates\iref {temp.over }.
146
+ that a function template can share a name with \grammarterm {using-declarator}s,
147
+ a type, non-template functions\iref {dcl.fct } and/or function templates\iref {temp.over }.
148
148
Specializations, including partial specializations\iref {temp.spec.partial },
149
149
do not reintroduce or bind names.
150
150
Their target scope is the target scope of the primary template,
151
151
so all specializations of a template belong to the same scope as it does.
152
+ \begin {example }
153
+ \begin {codeblock }
154
+ void f() {}
155
+ class f {}; // OK
156
+ namespace N {
157
+ void f(int) {}
158
+ }
159
+ using N::f; // OK
160
+ template<typename> void f(long) {} // #1, OK
161
+ template<typename> void f(long) {} // error: redefinition of #1
162
+ template<typename> void f(long long) {} // OK
163
+ template<> void f<int>(long long) {} // OK, doesn't bind a name
164
+ \end {codeblock }
165
+ \end {example }
152
166
\end {note }
153
167
154
168
\pnum
You can’t perform that action at this time.
0 commit comments