So, in order to allow code such as
auto vect = ...; auto it = vect.begin(), end = vect.end(); // want const_iterator, getting iterator
to pick the right overload of
end(), even for non-const containers, the more explicit
cend() functions were added.
Why stop there?
Associative containers have a
find() method with the same problem. Sequence containers have
back(), again with the same problem.
Are these missing explicit const versions omissions, or by design?