一直以来对于C++的使用基本上都是C with class,对于各种尖括号的模板都是敬而远之,最近忽然觉得该好好看看模板了.于是就有了这篇blog. 本文以一个查找问题为例来说明模板仿函数. 在C中,要实现一个通用的find函数(族)不大容易,有下面几种方案: 1,多个函数: int find_int(const int List[],const int nLen,const int Target) { ) { ; } ; ;i<nLen;i++) { if Target == List[i])