Someone here recently brought up the article from Scott Meyers that says:
- Prefer
iterators
overconst_iterators
(pdf link).
Someone else was commenting that the article is probably outdated. I'm wondering what your opinions are?
Here is mine: One of the main points of the article is that you cannot erase or insert on a const_iterator
, but I think it's funny to use that as an argument against const_iterators
. I thought the whole point of const_iterators
it that you do not modify the range at all, neither the elements themselves by substituting their values nor the range by inserting or erasing. Or am I missing something?