In the C++ language there is the default hash-function template std::hash for the most simple types, like std::string, int, e
boost::hash_combine is something that could help you out here:
namespace std
{
template <>
struct hash
{
std::size_t operator()(const CustomType& c) const
{
std::size_t result = 0;
boost::hash_combine(result, field1);
boost::hash_combine(result, field2);
return result;
}
};
}
See the boost doc here.