[temp.fct.spec.general] (original) (raw)
13 Templates [temp]
13.10 Function template specializations [temp.fct.spec]
13.10.1 General [temp.fct.spec.general]
A function instantiated from a function template is called a function template specialization; so is an explicit specialization of a function template.
Template arguments can be explicitly specified when naming the function template specialization, deduced from the context (e.g., deduced from the function arguments in a call to the function template specialization, see [temp.deduct]), or obtained from default template arguments.
Each function template specialization instantiated from a template has its own copy of any static variable.
[Example 1: template<class T> void f(T* p) { static T s;};void g(int a, char* b) { f(&a); f(&b); }
Heref<int>(int*)has a static variablesof typeintandf<char*>(char**)has a static variablesof typechar*.
— _end example_]