"Guideline: Remember that preferring auto variables is motivated primarily by correctness, performance, maintainability, and robustness—and only lastly about typing convenience." [1]
http://herbsutter.com/2013/08/12/gotw-94-solution-aaa-style-...
"Guideline: Remember that preferring auto variables is motivated primarily by correctness, performance, maintainability, and robustness—and only lastly about typing convenience." [1]
http://herbsutter.com/2013/08/12/gotw-94-solution-aaa-style-...
What? I want whatever he is smoking.
> correctness
C++ allows for casting to/from different types (the core behind polymorphism) - but if you cast to the wrong type then that's your own fault. If you want a warm fuzzy feeling of not worrying about bad casts - use Python/Go/FreeBASIC/some other language.
> performance
That is complete and utter delusion. Your program won't run any faster or optimize better because you used the auto keyword [1]. If anything - it will take even longer (ms longer) to compile.
> maintainability
I have an odd feeling about that. Yeah you can change the return type of a method or function and you don't have to worry about changing the code calling those methods/functions. But if you are changing to a vastly different type - you are going to have to change the calling code anyways.
> robustness
I don't want the compiler to fix my mistakes. I want the compiler to tell me how stupid I am and force me to fix them.
[1] http://stackoverflow.com/questions/19618759/c-11-auto-compil...
Which seems to be an often case in C++, class and class/typename comes to my mind. Also, old auto use was removed to the new set of meaning right?