function template:文章最後講到一個重點,我以前沒想到的。就是separation編譯模型,假定 module2.h 宣告了你的 template function,module2.cpp 裡則使用 export 來修飾你的 template function,以告知編譯器要保證當template function被實體化時,template的定義是可以使用的。簡單說就是沒有使用 export 的話,可能會有無法連結到某指定型別的 template function 的情況。描述的很差,表示我可能還不太懂,要找時間來試驗一下。




arrow
arrow
    文章標籤
    template 編譯器
    全站熱搜

    elleryq 發表在 痞客邦 留言(0) 人氣()