close
2, Function Templates
所謂 function templates,是指藉由參數化手段,來表現一整個族群的 functions。
2.1.2
一般而言,templates 不會被 compile 成能夠處理任意型別的單一 entity,而是為每個特定型別,被 compile 成多個個別 instance。
以具體型別替代 template parameters 的過程,稱為 instantiation。
2.2 Argument Deduction
在 template parameters 進行 argument deduction 時,並不允許自動型別轉換。
2.4 Overloading
function templates 可以被 overloading,在不同的 overloading 形式之間,最好只存在絕對必要的差異。
所謂 function templates,是指藉由參數化手段,來表現一整個族群的 functions。
2.1.2
一般而言,templates 不會被 compile 成能夠處理任意型別的單一 entity,而是為每個特定型別,被 compile 成多個個別 instance。
以具體型別替代 template parameters 的過程,稱為 instantiation。
2.2 Argument Deduction
在 template parameters 進行 argument deduction 時,並不允許自動型別轉換。
2.4 Overloading
function templates 可以被 overloading,在不同的 overloading 形式之間,最好只存在絕對必要的差異。
全站熱搜