Previous: http://www.bkjia.com/kf/201112/115312.html
16.6.4 some special templates
Template <class T1, class T2>
Class Some_Template {
Public:
T1 & Method1 (T2 & t ){
Return T1 ();
}
};
Template <class T1>
Class Some_Template <T1, int> {
Public:
T1 & Method1 (int & t ){
Return T1 ();
}
};
Template <class T1, class T2>
Class Some_Template {
Public:
T1 & Method1 (T2 & t ){
Return T1 ();
}
};
Template <class T1>
Class Some_Template <T1, int> {
Public:
T1 & Method1 (int & t ){
Return T1 ();
}
}; Partial specialization is also a template. Some special definitions appear like template definitions. These definitions start with the keyword template, followed by the template parameter table enclosed by Angle brackets (<>. The specific template parameter table is a subset of the corresponding class template definition parameter table.
16.7 overload and function Template
It is difficult to design a set of overloaded functions that contain both a function template and a non-template function, because it may make the function users feel strange and define a function template to be more specific than using a non-template version.
From xufei96's column