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
I am wondering the need for iteration. Map holds the key-value pairs and normally you use it for the lookup. If you still need to iterate the map for some reasons ( may be deleting pointers contained inside the map etc) then you can use std::for_each. Forget the micro optimizations and you can try to increase the code readability.