#include<iostream>#include<list>#include<map>#include<string>usingnamespace std;namespace _nmsp1
{intmf(int tmp1,int tmp2){return1;}intmf2(int tmp1,int tmp2){return10;}typedefint(*FunType)(int,int);template<typenameT,typenameF=FunType>voidtestfunc(T i, T j, F funcpoint = mf){
cout <<"void testfunc(T i, T j, F funcpoint = mf):"<<funcpoint(i,j)<< endl;}template<typenameT=int,typenameU>voidtestfunc2(U m){
T tmpvalue = m;
cout << tmpvalue << endl;}}intmain(){
_nmsp1::testfunc(15,16);// 返回1
_nmsp1::testfunc(15,16,_nmsp1::mf2);//不用缺省的类型,返回10
_nmsp1::testfunc2(12);return0;}