将C+模板函数定义存储在.cpp文件中
.h文件
class foo{public:
template <typename T>
void do(const T& t);};.cpp文件
template <typename T>void foo::do(const T& t){
// Do something with t}template void foo::do<int>(const int&);template void foo::do<std::string>(const std::string&);
繁星coding
森栏
一只名叫tom的猫
随时随地看视频慕课网APP