how to specify a pointer to an overloaded function?
- by davka
I want to pass an overloaded function to the std::for_each() algorithm. e.g.:
void f(char c);
void f(int i);
std::string s("example");
std::for_each(s.begin(), s.end(), f);
I'd expect the compiler to resolve f() by the iterator type. Apparently, it (gcc 4.1.2) doesn't do it. So, how can I specify which f() I want?
thanks a lot