Re: mem_fun & templates
Found the answer!
Code:
#include <algorithm>
#include <vector>
#include <functional>
using namespace std;
class Test
{
public:
void Function1(int t)
{
}
void Function2()
{
for_each(data.begin(), data.end(), bind1st(mem_fun(&Test::Function1), this));
}
private:
vector<int> data;
};
int main()
{
Test 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