[PATCH] Implement LWG 2686, hash<error_condition>

Jonathan Wakely jwakely@redhat.com
Thu Mar 23 17:49:00 GMT 2017


On 12/03/17 13:16 +0100, Daniel Krügler wrote:
>The following is an *untested* patch suggestion, please verify.
>
>Notes: My interpretation is that hash<error_condition> should be
>defined outside of the _GLIBCXX_COMPATIBILITY_CXX0X block, please
>double-check that course of action.

That's right.

>I noticed that the preexisting hash<error_code> did directly refer to
>the private members of error_code albeit those have public access
>functions. For consistency I mimicked that existing style when
>implementing hash<error_condition>.

I see no reason for that, so I've removed the friend declaration and
used the public member functions.

Although this is a DR, I'm treating it as a new C++17 feature, so I've
adjusted the patch to only add the new specialization for C++17 mode.
We're too close to the GCC 7 release to be adding new things to the
default mode, even minor things like this. After GCC 7 is released we
can revisit it and decide if we want to enable it for all modes.

Here's what I've tested and will be committing.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 3178 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20170323/cbca84da/attachment.bin>


More information about the Libstdc++ mailing list