Messaging system: Callbacks can be anything
I'm trying to write an event system for my game. The callbacks that my event manager will store can be both plain functions as well as functors. I also need to be able to compare functions/functors so I know which one I need to disconnect from the event manager. • Initially I tried using boost::function; it handles functions and functors perfectly well, except it has no operator==, so I can't remove callbacks if I want to. class EventManager { typedef boost::function<void (boost::weak_ptr<Event>)> Callback; std::map<Event::Type, std::vector<Callback>> eventHandlerMap_; }; • I also tried using