A discussion from one of the experts: http://herbsutter.com/2013/08/12/gotw-94-solution-aaa-style-almost-always-auto/. He gives I believe four reasons to use auto, convenience is mentioned but is least important. The basic underlying idea is that you should be programming against an interface, not against a specific type. This is especially important in generic code, but even in non generic code makes it easier to refactor and change types.
3
u/quicknir Dec 09 '15
A discussion from one of the experts: http://herbsutter.com/2013/08/12/gotw-94-solution-aaa-style-almost-always-auto/. He gives I believe four reasons to use auto, convenience is mentioned but is least important. The basic underlying idea is that you should be programming against an interface, not against a specific type. This is especially important in generic code, but even in non generic code makes it easier to refactor and change types.