CSV ファイルからマップをロードするテンプレート関数を定義します。
template <class T>
bool loadCSV (QString filename, map<T,int> &mapping){
// function here
}
私はそれを使用しようとします:
map<int, int> bw;
loadCSV<int>((const QString)"mycsv.csv",&bw);
しかし、htis コンパイル時エラーが発生します。
error: no matching function for call to
‘loadCSV(const QString, std::map<int, int, std::less<int>, std::allocator<std::pair<const int, int> > >*)’
関数呼び出しがいくつかの暗黙の引数を取り込んでいるようですが、エラーとその修正方法がわかりません。何か案は?