This repository has been archived by the owner on Dec 26, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Issue #80, it was reported that Heterogenious lookup did not work properly.
I found that this bug occurs under the following conditions.
std::hash
robin_hood::hash
Since
robin_hood::hash
inherits fromstd::hash
, it was expected thatoperator()
ofstd::hash<Key>
would be called when a type other thanKey
is passed tooperator()
ofrobin_hood::hash<Key>
.However, it turns out that
operator()
ofstd::hash
is hidden byoperator()
ofrobin_hood::hash
.cf.)
What I would like to do with this pull request
Correctly call
operator()
ofstd::hash
inoperator()
ofrobin_hood::hash
.Specific proposals
robin_hood::hash::operator()
is currently declared as follows.I would like to replace the above declaration with the one below.
Also add an enabler to check if the intended
operator()
is defined instd::hash<T>
.Comments on Issue #80
The reason why the first comment in #80 works is that it is possible to convert from
std::string_view
tostd::string
.On the other hand, the following comment does not work because the conversion from
std::string_view
toboost::beast::static_string<N>
is impossible.Related issues
Closes #80