If you're looping through a container as such:
typedef std::vector<std::unique_ptr<BaseClass>> Container;
Container container;
for(Container::const_iterator element = container.begin(); element != container.end(); element++)
{
//Read through values
}
And instead of using the typedef you decide to use auto:
std::vector<std::unique_ptr<BaseClass>> container;
for(auto element = container.begin(); element != container.end(); element++)
{
//Read through values
}
Assuming you don't alter the values, does the auto keyword use a const iterator over a non const one?
This question is curiosity more than anything, the only reason I can see this being an applicable question in a real life scenario would be if you needed to communicate that you weren't to alter values to another person working on the code.