Why is there no operator +/- for a bidirectional iterator?

前端 未结 3 651
误落风尘
误落风尘 2021-01-25 11:46

My own reasoning for it is that there is no random access and there is no way to know the bounds. But then why do we have std::advance? [EDIT] And come to think of

3条回答
  •  有刺的猬
    2021-01-25 12:15

    The reason we have std::advance is that it provides a way to advance an iterator using the most effiecient way supported by that iterator.

提交回复
热议问题