我很新的模板元編程,並不能找到我的思維錯誤在這種方法:專營函數模板結果
template <typename T>
typename T::ReturnType Query(const std::string& Str);
template <>
ResultTypeRowCount Query(const std::string& Str) { return this->queryRowCount(Str); }
ResultTypeRowCount實現與名稱返回類型
三江源閱讀公衆的typedef
你能詳細說明你在這裏做什麼嗎? C++不會推導出函數的返回類型,因爲僅僅給出參數就沒有辦法推導出'T'。你在這裏預期的行爲是什麼? – templatetypedef
我想歸檔某種返回類型的重載。由於我無法將模板聲明爲虛擬函數,因此我無法將函數映射到專業化。 – Mythli