Someone here recently brought up the article from Scott Meyers that says:
iterators
over const_iterators
(pdf link).
I don't think this particular statement of Meyer's needs to be taken with special concern. When you want a non-modifying operation, it is best to use a const_iterator
. Otherwise, use an ordinary iterator
. However, do note the one important thing: Never mix iterators i.e. const
ones with non-const
ones. As long as you are aware of the latter, you should be fine.