The program won't link because the two functions int max(int, int) and char max(char, char) are not defined.

numnum (numnum)
In order to tell compiler that you are using a templated function, you have put the angle bracket after the function name: cout<<max<int>(i,i)<<encl;
(#112497@0)
2001-6-26 -05:00

回到话题: C++中模板函数的重载

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论

URL:   
http://www.rolia.net/zh/post.php?f=0&p=112497