Hi everyone :) I have a problem with function pointers
My \'callback\' function arguments are:
1) a function like this: int(*fx)(int,int)
2) an int variable: int a<
Functions cannot be referenced this way:
int (*function3)(int, int) = obj.*function2;
You have to pass the address of the function like this:
int (*function3)(int, int) = std::mem_fn(&A::sub, obj); // ^^^^^^^^^^^^^^^^^^^^^^^^^
The expression function2 decays into a pointer-to-function which allows it to work.