It would be good to use a standard hash library like boost::hash in boost functional.