I have a template class
Vector<class T, int N>
Where T is the type of components (e.g. double) and n is the number of components (so N = 3 for a 3D vector)
Now I want to write a method like
double findStepsize(Vector<double,2> v) {..}
I want to do this also for three or higher dimensional vectors. Of course, I could just introduce additional methods for higher dimensions, but the methods will have a lot of redundant code, so I want a more general solution. Is there a way to create a method that accepts a template class without further specializing (in this case, without specifying T or N)? how
double findStepsize(Vector<T,N> v)
?
source share