Opened 11 years ago
Closed 9 years ago
#6792 closed Feature Requests (fixed)
hash_value() for iterator_range
Reported by: | Owned by: | Neil Groves | |
---|---|---|---|
Milestone: | Boost 1.56.0 | Component: | range |
Version: | Boost 1.48.0 | Severity: | Problem |
Keywords: | Cc: |
Description
"hash_value(boost::iterator_range<const char*>());" uses "operator unspecified_bool_type() const" which is not right.
Could you support hash_value() properly? Could you remove operator bool()?
Change History (5)
comment:1 by , 11 years ago
Component: | None → range |
---|---|
Owner: | set to |
comment:2 by , 11 years ago
Milestone: | To Be Determined → Boost 1.50.0 |
---|---|
Status: | new → assigned |
Type: | Bugs → Feature Requests |
I'll attempt to implement the additional hash_value support by release 1.50. It looks simple enough. I will not remove the conversion to bool since this is a documented part of the public interface, and is not in error.
comment:3 by , 9 years ago
Milestone: | Boost 1.50.0 → Boost 1.56.0 |
---|
comment:5 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
hash_value
would be nice for iterator range. See [77976] for how an example of how to support it,hash_value
is picked up by ADL.The problem with operator bool is really a design flaw in Boost.Hash. It should be possible to turn it into an error by defining the macro
BOOST_HASH_NO_IMPLICIT_CASTS
, although that isn't defined by default because it might break valid code.