Why are you changing declarations everywhere to use auto?

This topic was already discussed in length here:

I stated my opinion there, but am happy to reiterate:

auto has more advantages in my opinion:

  • a variable deduced with auto can never be uninitialised
  • when the code is refactored, you avoid unconscious unnecessary implicit casts

And I follow Herb Sutter here, who has more good reasons to prefer almost always auto

8 Likes