The return types of the member functions that take a hint to insert an element are different between robin_hood::unordered_map and std::unordered_map.
As a result, to use robin_hood::unordered_map, we need to do more than just replace std::unordered_map with robin_hood::unordered_map.
I feel that this is preventing users from using robot_hood::unordered_map.
What I would like to do with this pull request
Make the return type of member functions of robin_hood::unordered_map that take a hint to insert an element consistent with std::unordered_map.
Specific proposals
The member functions of robin_hood::detail::Table that take a hint to insert an element are currently declared as follows.
I would like to replace the above declaration with the one below.
Some may argue that making the above change makes it impossible to know whether an element was actually inserted or not.
If this slight difference between robin_hood::unordered_map and std::unordered_map is intentional, please abandon this proposal.
Thanks @acd1034 for the contribution! This was a copy & paste error on my side, and not intentional. No idea why the standard just returns an iterator instead of the pair, but it's better to stick with that.
The return types of the member functions that take a hint to insert an element are different between
robin_hood::unordered_map
andstd::unordered_map
. As a result, to userobin_hood::unordered_map
, we need to do more than just replacestd::unordered_map
withrobin_hood::unordered_map
. I feel that this is preventing users from usingrobot_hood::unordered_map
.What I would like to do with this pull request
Make the return type of member functions of
robin_hood::unordered_map
that take a hint to insert an element consistent withstd::unordered_map
.Specific proposals
The member functions of
robin_hood::detail::Table
that take a hint to insert an element are currently declared as follows.On the other hand, the corresponding functions of
std::unordered_map
are declared as follows.Reference: Working Draft, Standard for Programming Language C++ - ISO C++ standards committee
I would like to replace the above declaration with the one below. Some may argue that making the above change makes it impossible to know whether an element was actually inserted or not. If this slight difference between
robin_hood::unordered_map
andstd::unordered_map
is intentional, please abandon this proposal.Best regards.