S
saneman
I have this template function:
template <typename V, typename I>
void increasing_sequence(I p, I q) {
int j = 1;
while (p != q) {
*p = V(j);
j++; // increasing
++p;
}
}
I then call it with:
increasing_sequence<int>(v.begin(), v.end());
where v could be a container like std::vector. But why is that call
legal? I only specify one template parameter and the function has two.
template <typename V, typename I>
void increasing_sequence(I p, I q) {
int j = 1;
while (p != q) {
*p = V(j);
j++; // increasing
++p;
}
}
I then call it with:
increasing_sequence<int>(v.begin(), v.end());
where v could be a container like std::vector. But why is that call
legal? I only specify one template parameter and the function has two.