討論串[問題] 有辦法用大於小於來啟動function嘛
共 5 篇文章
內容預覽:
另一個方法是用 template. template <class CMP> void f(int a, int b). {. CMP cmp;. cout << "comparing " << a << " and " << b << ": ";. if( cmp(a, b) ). cout <<
(還有586個字)
內容預覽:
^^^^ 這個是指 '<' 吧?. 嗯嗯嗯 只能有一個的話 我也不知道如何用C. 不過 如果用組合語言 可以直接修改 func的資料. 然後 CS:IP指過去 就可以當 instruction跑了. 取巧一點 兩個實體的話. 可以用 array of function point 然後 切換使用.
(還有384個字)
內容預覽:
用了funtion pointer或function object了. function的部分合必用template呢?. 這這樣會有個缺點. 若是比較函數以外的部分過多. 會造成冗餘重複的程式碼. 因每個不同TYPE的template皆會在執行檔中產生相對的程式碼. 若用. void f(type
(還有132個字)