Is there a way for the Visual Studio compiler to determine the template parameter M without passing the size of the array as a template parameter to a templatized function like how gcc can determine?
To give an example -
template<unsigned M>
void multiply(
double A[M][M],
double B[M][M]
)
{
..........
}
A and B are arrays in the above example. So for the above example, in gcc if you call the above function as multiply(A, B);
the code compiles successfully whereas in visual studio you get a compiler error - "no overloaded function found".
But in visual studio only if you call the above function as multiply<M>(A, B);
where M is the size of arrays A and B, the code compiles successfully.
So basically my question is that is there a way to call the function as multiply(A, B);
successfully in visual studio without passing the template parameter 'M'?
Tried calling the function 'multiply' as multiply(A, B);
in visual studio and expected it to work but it did not.