File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 143143\begin {note }
144144A template cannot have the same name as any other
145145name 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 }.
148148Specializations, including partial specializations\iref {temp.spec.partial },
149149do not reintroduce or bind names.
150150Their target scope is the target scope of the primary template,
151151so 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 }
152166\end {note }
153167
154168\pnum
You can’t perform that action at this time.
0 commit comments