I\'m using std::map
to store a lot of elements (pairs of elements) and I have a \"little\" doubt. What is more efficient to iterate all elements over my
There will likely be no difference. std::reverse_iterator is just a template shim that translates ++'s to --'s at compile time.
For a vector or other contiguous storage container, a forward iterator might interact very slightly better with the cache than a reverse iterator would (unlikely you'd be able to detect it), but for a tree-based container it won't make any difference at all--there won't be any locality of reference to exploit.