There are no technical reasons why unordered_map cannot have bidirectional iterators. The main reason is that this will add additional implementation costs, and the designers thought that no one would need bidirectional iterators for the hash map. After all, there is no order in the hash, and so the order that the iterator gives you is completely arbitrary. What can happen with a fixed but arbitrary backward order?
Typically, you could access unordered_map for each element or go through the entire map. I have never done otherwise in Perl. This requires an advanced iterator, and therefore there is one, and Boost guarantees it. To have bidirectional iterators, you probably need to include an extra pointer in each record, which increases memory usage and processing time.
I have not come up with a good, believable option for bidirectional iterators. If you can, you can ask Boost maintainers to consider this, although you are almost certainly too late for C ++ 0x.
David thornley
source share