Can two functors be compared for equality?
Is there a way for a method, which receives two functors as arguments, to find out if they are pointing to the same function? Specifically, having a struct like this: struct FSMAction { void action1() const { std::cout << "Action1 called." << std::endl; } void action2() const { std::cout << "Action2 called." << std::endl; } void action3() const { std::cout << "Action3 called." << std::endl; } private: // Maybe some object-specific stuff. }; And a method like this: bool actionsEqual( const std::function<void(const FSMAction&)>& action1, const std::function<void(const FSMAction&)>& action2) { //