+namespace std
+{
+
+/* Specialization of std::hash for gdb_exception. */
+template<>
+struct hash<gdb_exception>
+{
+ size_t operator() (const gdb_exception &exc) const
+ {
+ size_t result = exc.reason + exc.error;
+ if (exc.message != nullptr)
+ result += std::hash<std::string> {} (*exc.message);
+ return result;
+ }
+};
+
+}
+