2013-06-26 48 views
1

迭代遍歷映射保證按順序完成(根據定義的比較函數)。C++:遍歷std :: hash_map的順序

那麼hash_map例如有什麼保證順序,當通過這個從begin()end()迭代?

+2

我認爲這是我第一次看到stl標籤在實際使用的地方。 –

+0

@BenjaminLindley:這是否合適? AFAIK'hash_map'不是STL的一部分...... –

+0

@DavidRodríguez-dribeas:這不是斯捷潘諾夫原來的建議,但它一定是在時間和1997年之間的某個時間加入的。因爲它是[這裏](http: //www.sgi.com/tech/stl/hash_map.html),並沒有任何更新[這裏](http://www.sgi.com/tech/stl/whats_new.html),其中最古老的是從1997年起,提及其增加。 –

回答

3

不,hash_map或標準等效std::unordered_map無序容器。