On 04/05/19 15:36 +0100, Jonathan Wakely wrote: >On 03/05/19 23:42 +0100, Jonathan Wakely wrote: >>On 23/03/17 17:49 +0000, Jonathan Wakely wrote: >>>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 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 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. >>> >>>I see no reason for that, so I've removed the friend declaration and >>>used the public member functions. >> >>I'm going to do the same for hash too. It can also use the >>public members instead of being a friend. >> >> >>>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. >> >>We never revisited that, and it's still only enabled for C++17 and up. >>I guess that's OK, but we could enabled it for C++11 and 14 on trunk >>if we want. Anybody care enough to argue for that? >> >>>Here's what I've tested and will be committing. >>> >>> >> >>>commit 90ca0fd91f5c65af370beb20af06bdca257aaf63 >>>Author: Jonathan Wakely >>>Date: Thu Mar 23 11:47:39 2017 +0000 >>> >>> Implement LWG 2686, std::hash, for C++17 >>> 2017-03-23 Daniel Kruegler >>> Implement LWG 2686, Why is std::hash specialized for error_code, >>> but not error_condition? >>> * include/std/system_error (hash): Define for C++17. >>> * testsuite/20_util/hash/operators/size_t.cc (hash): >>> Instantiate test for error_condition. >>> * testsuite/20_util/hash/requirements/explicit_instantiation.cc >>> (hash): Instantiate hash. I'm adding a similar test for hash too. Tested powerpc64le-linux, committing to trunk shortly.