C++ Iterator dereference and prefix increment/decrement style? Is *--Iter ok style wise?

后端 未结 4 1608
[愿得一人]
[愿得一人] 2021-01-22 22:56

In coding with C++ iterators if you wanted to get the previous value to what an iterator points to would you write:

*--Iter

or would you think

4条回答
  •  礼貌的吻别
    2021-01-22 23:42

    Either is fine. Use the one preferred by any coding standard you need to obey, or the one you prefer personally.

提交回复
热议问题