私はテンプレートを初めて使用し、ここのフォーラムで私の問題に対する答えを見つけることができませんでした。おそらく、何を正確に検索すればよいかわかりません。
私のコード:
template<class T>
vector<T> properDivisors(T input) {
vector<T>retVal;
for(T d = T()+1;d<input;d++) {
if((double)input/(double)d == input/d)
retVal.push_back(d);
}
return retVal;
}
template<class T>
T sumTypeOf(T input) {
vector<T>divisors = properDivisors(T);
return someEnum;
}
コンパイルすると、次の行でエラーが発生します。
vector<T>divisors = properDivisors(T);
エラー: エラー: ')' トークンの前にプライマリ式が必要です