Patch for LWG issue #2148
Howard Hinnant
hhinnant at apple.com
Thu Aug 29 13:55:59 PDT 2013
On Aug 28, 2013, at 11:17 AM, Marshall Clow <mclow.lists at gmail.com> wrote:
> Issue 2148 adds std::hash behavior for enumerations.
> Add this support, and a test case.
We shouldn't make the assumption in the test that hash<integral>{}(i) == i. Instead the test should get the underlying type of the enum and assert(h(t) == std::hash<underlying_type>{}(static_cast<underlying_type>(i))).
Also could you test an unscoped enum as well.
And could you add a .fail to make sure the std::hash<X>{}(x) for some struct X {}. We should've had this before and don't. So don't put the .fail under _LIBCPP_STD_VER > 11.
Thanks!
Howard
More information about the cfe-commits
mailing list