I want to use an function that requires the parameter to be an Iterator, is possible to apply it with an STL algoritm like std::for_each ?
std::vector<int> v({0,1,2,3,4});
std::for_each(v.begin(), v.end(), [](std::vector<int>::iterator it)
{
// Do something that require using the iterator
// .....
});
std::for_eachwill pass an object from the container, not iterator. You should use explicit cycle that uses iterators. Make a function (probably template) from it.