I have the following shell class:
template <typename T> class Remap { public: Remap(T *data, int *remap) : data(data), remap(remap){}; T &operator[](std::size_t idx) const { return data[remap[idx]]; } private: T *data; int *remap; };
It works fine if I call it:
Remap<double> remap(data, remap);
where the data is of type double * . If I try to let the compiler (intel icc 15.0.3, with -std = C ++ 11) infer the type of the template:
Remap remap(data, remap);
Error with error message:
argument list for class template "Remap" is missing
I try not to violate the DRY principle and, therefore, would like to fix this problem.
c ++ c ++ 11 templates c ++ 14 type-deduction
schorsch312
source share