how portable is end iterator decrement?

前端 未结 3 1741
庸人自扰
庸人自扰 2020-11-30 02:43

Just encountered decrement of end() iterator in my company source codes and it looks strange for me. As far as I remember this was working on some platforms, bu

3条回答
  •  执笔经年
    2020-11-30 03:25

    This code is not OK, in case list is empty you are in trouble.

    So check for that, if list is not empty the code is very fine.

提交回复
热议问题