Is it possible to create in C++11
a function, which will accept any iterator
as input argument in particular stl containers like vector
or list
?
I want to write something like
void f(iterator<int> i){
for (auto el : i)
cout << el;
}
int main(){
vector<int> v;
list<int> l;
...
f(v);
f(l);
}
Is it possible?