c++ - Does std::unordered_multimap's bucket only contain elements with equivalent keys -
on www.cplusplus.com, states following unordered_multimap,
elements equivalent keys grouped in same bucket , in such way iterator (see equal_range) can iterate through of them.
i know cannot infer statement, i'd know if given bucket only contains elements equivalent keys?
here pertinent requirements:
[c++11: 23.2.5/5]:2 valuesk1,k2of typekeyconsidered equivalent if container’skey_equalfunction object returns true when passed values. ifk1,k2equivalent, hash function shall return same value both. [..]
[c++11: 23.2.5/8]:elements of unordered associative container organized buckets. keys same hash code appear in same bucket. [..]
there nothing prohibiting all elements key hash a , all elements key hash b being stored in same bucket. standard library implementation use whether or not fact used.
no standard wording exists make explicit; it's defined omission.
Comments
Post a Comment