4 ms·
There are a ton of times in C++ or any language where you want the type. If having the type makes the code more readable, you should have it.
by SamReidHughes 12y ago
There are a ton of times in C++ or any language where you want the type. If having the type makes the code more readable, you should have it.
- RogerL 12y agoThis is what everyone is saying. The only question is whether to ever use auto in non-generic code. I think it is unarguable that if you can write foo(goo()) in a clean way you can equally use auto. And if you can't do the former, you probably can't do the latter. Balance, proportion, judgment, and code reviews are how you get great code, not 'never' and 'always' rules (which your comment makes clear you agree with).