[RESOLVED] mem_fun & templates
This is the first time I've used std::mem_fun and I'm at a loss to figure out what I have to do to get this to compile.
Code:
#include <algorithm>
#include <vector>
#include <functional>
using namespace std;
template <typename T>
class Test
{
public:
void Function1(T &t)
{
}
void Function2()
{
for_each(data.begin(), data.end(), mem_fun(&Test<T>::Function1)); // Error here.
}
private:
vector<T> data;
};
int main()
{
Test<int> test;
test.Function2();
}
"It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
Richard P. Feynman