2 ms·
> Surely the code only works with vectors, but when one deals with vector of pairs, it implies very specific problem that rather unlikely to change. maybe, may
by jcelerier 8y ago
> Surely the code only works with vectors, but when one deals with vector of pairs, it implies very specific problem that rather unlikely to change.
maybe, maybe not. I often have much deeper changes than this.
> It also show that the need for auto really comes from the design of STL that leads to very long types that auto mitigates.
the same problem exists with int32_t or uint32_t or even int or char. The point is, using auto makes your code much more resilient to changes and much less likely to introduce bugs or performance losses due to unwanted conversions.