summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/bits/functional_hash.h
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/include/bits/functional_hash.h')
-rw-r--r--libstdc++-v3/include/bits/functional_hash.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/libstdc++-v3/include/bits/functional_hash.h b/libstdc++-v3/include/bits/functional_hash.h
index 022c5caf4cc..d5658fe4c50 100644
--- a/libstdc++-v3/include/bits/functional_hash.h
+++ b/libstdc++-v3/include/bits/functional_hash.h
@@ -59,5 +59,21 @@
# undef _GLIBCXX_INCLUDE_AS_CXX0X
#endif
+#include <system_error>
+
+namespace std
+{
+ template<>
+ struct hash<error_code> : public unary_function<error_code, size_t>
+ {
+ size_t
+ operator()(error_code __e) const
+ {
+ const char* __p = reinterpret_cast<const char*>(&__e);
+ return _Fnv_hash<>::hash(__p, sizeof(__e));
+ }
+ };
+}
+
#endif // _FUNCTIONAL_HASH_H
OpenPOWER on IntegriCloud