Opened 8 years ago
Closed 5 years ago
#11145 closed Bugs (fixed)
Unable to hash char16_t or char32_t
Reported by: | Owned by: | Daniel James | |
---|---|---|---|
Milestone: | To Be Determined | Component: | hash |
Version: | Boost 1.56.0 | Severity: | Problem |
Keywords: | Cc: |
Description
boost::hash doesn't work on char16_t or char32_t data. This did work previously (at least as recently as boost 1.49). There doesn't seem to have been a hash_value overload for them, but it looks like they were implicitly converted to something that was supported.
Reproduction Code
#include <boost/functional/hash.hpp> #include <string> void foo() { std::u16string s; auto h = boost::hash<decltype(s)>()(s); }
Change History (5)
comment:1 by , 8 years ago
comment:3 by , 5 years ago
Just ran into this as well. Newer ICU will typedef UChar as char16_t, which then means UChar is no longer hashable by Boost. Please fix...
comment:5 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
I have a patched version of boost/functional/hash/hash.hpp which works with char16_t and char32_t, but I can't seem to attach it (the spam filter is unhappy with it).
Basically the change is the addition of the following: