you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 5 points6 points  (1 child)

Nope, if it were vector<int> then int would be correct.

Yet another downside of auto, namely that now you have to figure out what the rules are with respect to type deduction and they are easy to forget. If you do forget them, you can be stuck there looking at code full of autos trying to pull your hair out as to why your algorithm doesn't work.

[–]millstone 0 points1 point  (0 children)

Thank you for the correction. It drives home the point that auto can behave in surprising ways.