Hello.
If I was to call a method of class T, M for each element in a collection,
I'd do it like this:
vector<int> vec;
....
for_each(vec.begin(), vec.end(), mem_fun_ref(&T::M));
Okay, I can see that mem_fun_REF makes it obvious that I must use a
reference, but why? Is it not possible to pass a function by-reference? As I
see it, T::M is being passed as a pointer here.
void func(int& val); func(12); << reference
void func(int* val); int val = 12; func(&val); << pointer
//Anders