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