I am trying to use the for_each from stl algorithm.
http://www.cplusplus.com/reference/algorithm/for_each.html
#include <algorithm>
#include <vector>
#include <iostream>
template <typename T>
void OutputObject(const T &obj)
{
cout << obj << endl;
}
template <typename T>
void OutputVector(const vector<T> &V)
{
for_each (V.begin(), V.end(), OutputObject);
cout << endl;
}
I get "no matching function call to for_each". Why would that be?
Thanks,
Dave