c++ what's the result of iterator + integer when past-end-iterator?

前端 未结 5 2083
生来不讨喜
生来不讨喜 2021-01-13 02:28

suppose you have a random access iterator (eg of std::vector myVector)

when iter + someInt is past-end-iterator, iter + someInt == my

5条回答
  •  情歌与酒
    2021-01-13 03:21

    It's undefined behaviour, the standard says nothing about the result of that.

提交回复
热议问题