How to hash and compare a pointer-to-member-function?
How can i hash (std::tr1::hash or boost::hash) a c++ pointer-to-member-function? Example: I have several bool (Class::*functionPointer)() (not static) that point to several diferent methods of the class Class and i need to hash those pointer-to-member-function. How can i do that? Also how can i compare (std::less) those member function pointers so i can store them in a std::set? All C++ objects, including pointers to member functions, are represented in memory as an array of chars. So you could try: bool (Class::*fn_ptr)() = &Class::whatever; const char *ptrptr = static_cast<const char*>