If nothing else, a const_iterator
reads better, since it tells anyone reading the code “I’m just iterating over this container, not messing with the objects contained”.
That’s a great big win, never mind any performance differences.
If nothing else, a const_iterator
reads better, since it tells anyone reading the code “I’m just iterating over this container, not messing with the objects contained”.
That’s a great big win, never mind any performance differences.