Quote from The C++ standard library: a tutorial and handbook : 引用来自C ++标准库:教程和手册 : 函数
The only portable way of using templates at the moment is to implement them in header files by using inline functions. 目前使用模板的惟一可移植方法是经过使用内联函数在头文件中实现它们。 this
Why is this? 为何是这样? google
(Clarification: header files are not the only portable solution. But they are the most convenient portable solution.) (澄清:头文件不是惟一的可移植解决方案。可是它们是最方便的可移植解决方案。) spa