How does the below code work??
template <size_t MAX>
array<int,MAX>& operator-(array<int,MAX>& a, array<int,MAX>& b)
{
array<int, MAX> c;
int i = 0;
while (i != MAX)
{
c[i] = a[i] - b[i];
i++;
}
retu c;
}
Calling ::
array<int, 6> c = b - a;
I wonder how MAX get its value from the array subscript operator. In that case can we call the functions without giving the size of object in case if it is needed??
