iterator vs reverse_iterator

前端 未结 6 1606
暗喜
暗喜 2021-01-05 05:52

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

6条回答
  •  日久生厌
    2021-01-05 06:12

    Me think it does not make sense to use a reverse_iterator; it's counter intuitive.

    It would make the code harder to understand, someone will look at the code and go "wtf"; and if you need to put a comment to explain why, it probably means it's not good code to start with.

提交回复
热议问题