使用模板能够极大到使得代码可重用。 记录一下,方便后续使用。 1. 函数模板,支持多种类型参数 2. 迭代器模板,支持多种容器 3.类模板 test_temple.h test_temple.cpp test.h main.cpp