Should I prefer iterators over const_iterators?

前端 未结 6 2161
没有蜡笔的小新
没有蜡笔的小新 2020-12-14 16:07

Someone here recently brought up the article from Scott Meyers that says:

  • Prefer iterators over const_iterators (pdf link).
6条回答
  •  一生所求
    2020-12-14 16:59

    I totally agree with you. I think the answer is simple: Use const_iterators where const values are the right thing to use, and vice versa. Seems to me that those who are against const_iterators must be against const in general...

提交回复
热议问题