Opened 10 years ago
Closed 9 years ago
#7294 closed Feature Requests (fixed)
boost::hash does not compile with ranges
Reported by: | Owned by: | Neil Groves | |
---|---|---|---|
Milestone: | Boost 1.56.0 | Component: | range |
Version: | Boost 1.51.0 | Severity: | Problem |
Keywords: | Cc: | dnljms@… |
Description
boost::hash from boost 1.51 does not compile with iterator_range<const char*>. With boost 1.50 all compiles and works fine. Test program attached. gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
hash_range.cc:15:50: instantiated from here /opt/boost_1_51_0/include/boost/functional/hash/extensions.hpp:257:34: error: no matching function for call to ‘hash_value(const boost::iterator_range<const char*>&)’
Attachments (1)
Change History (7)
by , 10 years ago
Attachment: | hash_range.cc added |
---|
comment:2 by , 10 years ago
Summary: | boost::hash does not compiles with ranges → boost::hash does not compile with ranges |
---|
comment:3 by , 10 years ago
Component: | hash → range |
---|---|
Owner: | changed from | to
Type: | Bugs → Feature Requests |
That's a bug fix, iterator_range has an implicit conversion to bool, which is why is was hashing - you really don't want that because it will only hash to 0 or 1. So it might have worked, but you get terrible performance for more than a few items.
If you want hashing support for iterator_range
it will need to be added to that library. For an example of how to do that, open boost/array.hpp and search for 'hash'. It shouldn't be too hard to implement.
comment:4 by , 10 years ago
Cc: | added |
---|
comment:5 by , 9 years ago
Milestone: | To Be Determined → Boost 1.56.0 |
---|---|
Status: | new → assigned |
Implemented and committed to the develop branch.
comment:6 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |