std::unordered_map and the % operator
Jonathan Wakely
jwakely.gcc@gmail.com
Sun Mar 16 19:40:00 GMT 2014
On 16 March 2014 19:31, Ryan Lewis wrote:
>
> I'm not sure I see why a local_iterator would need to store the extra
> struct, but, i'll take your word for it.
Because the local_iterator contains the hash function. If you want to
add data to the hash function, you increase its size, and the size of
anything that contains it.
You can easily verify that by adding a member to the
_Mod_range_hashing struct, which is the one that would need to be
replaced to avoid the modulus operation, and checking
sizeof(unordered_map<int,int>::local_iterator).
More information about the Libstdc++
mailing list