What is the difference between accessing vector elements using an iterator vs an index?

前端 未结 4 2106
名媛妹妹
名媛妹妹 2021-02-19 09:29

What advantages are there in accessing vector elements using an iterator vs an index?

4条回答
  •  滥情空心
    2021-02-19 09:46

    This question was asked by me recently regarding performance. You might want to take a look at the answers I got.

    Check the following link: Iterators vs. indexes

    The discussion was mainly about performance, which turned out to be platform dependant, with minor changes in each platform.

提交回复
热议问题