On Aug 29, 2013, at 1:55 PM, Howard Hinnant <[email protected]> wrote:

> On Aug 28, 2013, at 11:17 AM, Marshall Clow <[email protected]> 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.

Done and done.

> 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.

I put it under a __cplusplus >= 201103L instead, since there's no hash in C++03.

Updated patch attached.

-- Marshall

Marshall Clow     Idio Software   <mailto:[email protected]>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly 
moderated down to (-1, Flamebait).
        -- Yu Suzuki

Attachment: ish2128-2.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to