爲何只能在頭文件中實現模板? - Why can templates only be implemented in the header file?

問題:

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


解決方案:

參考一: https://stackoom.com/question/24mD/爲何只能在頭文件中實現模板
參考二: https://oldbug.net/q/24mD/Why-can-templates-only-be-implemented-in-the-header-file
相關文章
相關標籤/搜索