Fixes for LWG 2598, 2686, 2739, 2742, 2747, and 2759, which were adopted last week in Issaquah
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286858 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/system_error b/include/system_error
index faaeaa0..c7e73d4 100644
--- a/include/system_error
+++ b/include/system_error
@@ -219,6 +219,7 @@
bool operator!=(const error_condition& lhs, const error_condition& rhs) noexcept;
template <> struct hash<std::error_code>;
+template <> struct hash<std::error_condition>;
} // std
@@ -629,6 +630,17 @@
}
};
+template <>
+struct _LIBCPP_TYPE_VIS_ONLY hash<error_condition>
+ : public unary_function<error_condition, size_t>
+{
+ _LIBCPP_INLINE_VISIBILITY
+ size_t operator()(const error_condition& __ec) const _NOEXCEPT
+ {
+ return static_cast<size_t>(__ec.value());
+ }
+};
+
// system_error
class _LIBCPP_TYPE_VIS system_error