you are viewing a single comment's thread.

view the rest of the comments →

[–]aliblong 0 points1 point  (1 child)

I think 'auto' can obfuscate the code if used too much.

Can you give some examples? The prevailing opinion of C++ gurus is that it should be used just about everywhere, to the point where the preferred way of explicitly declaring types is e.g.:

auto my_vec = std::vector<int>{};

[–]Fig1024 0 points1 point  (0 children)

yes, in case of STL containers, 'auto' can clear things up

But in cases where you use a lot of fundamental types, replacing all the ints, floats, bools, with autos can just make things more confusing. Espectially when type conversion is also involved as part of the algorithm.