How to compare STL function object with function pointer
How to compare STL function objects and function pointers? in view of this problem, this article introduces the corresponding analysis and solutions in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
Definition and use of function objects and function pointers
The two are defined in different ways and used in the same way.
# include using namespace std;//function objectclass obj_Add {public: int operator () (int val1, int val2) {return val1 + val2;}}; / function pointerint fun_Add (int val1, int val2) {return val1 + val2;} int main (int argc, char * argv []) {/ / function object obj_Add obj_add; cout