1. Function Template 1.1 Function Template Definition Function Template The definition of the type template, such as Template type min (Type A, Type B) {Return A B;} is also use Template , You can also use Template , which define the return value type, parameter type, parameter type, or use keywords size defined constants in the function template, such as: Template Type Test (Const TYPE (* a) {type b = a [0]; return b;} The above code defines a constant using INT, which can use non-TypenAme / Class to define constants, and then incorporate the quotation of the array. TypeName has another effect, which means that a parameter is a type instead of a value, such as Template Parm Test (Parm * K, u value) {Typename Prm :: Name * p;} Here, use Typename, PARM :: Name is a data type, not a value, so the entire expression is a pointer P. If there is no TypenAme description, PARM :: Name is PARM :: Name is a static variable in the class PARM, then the entire expression is multiplied by two values. 1.2 Template function The use of the template function is very simple, like the function using the function, such as COUT << min (1, 2) << endl. I don't know how to use the above two module functions. It is always wrong in VC . You can also define the function pointer points to the function module, and then use the function to correct the needle, such as int (* p) (int A, int b) = & min; // To add the address symbol, otherwise in VC COUT << (* p) (1, 2) << ENDL;