| ▲ | badsectoracula 3 hours ago | |
> How important is that, the ability to be certain of the type of some iterated value from a container from one line in total isolation? As important as the code to be readable. > The odds are very good that it's clear from the context As i wrote, if the actual type can be seen somewhere nearby (close enough to be included in diffs) then that's fine - it is already in the context. Though that is not usually the case and i personally had to work with code with which i was not familiar and which used `auto` all over the place and had to go hunting for the actual container declaration to see what it is (Visual Studio was not helpful in its tooltips). So my actual experience is that i'd rather see the actual type. However... > anyway, in this case the real win probably is the range-based for loop ...yes, the range-based for loop is often the better choice when it comes to readability. And when compared with the iterators, it is pretty much always more readable than them :-P. `for (const Foo& foo : foos)` is basically what i'd prefer to see. It is the use of `auto` i pointed out. | ||