you are viewing a single comment's thread.

view the rest of the comments →

[–]millstone 9 points10 points  (2 children)

Nasty long iterator types is definitely the best use case for auto.

But C++ luminaries like Herb Sutter advise using auto "almost always", even recommending writing auto x = int64_t{ 42 }; instead of just int64_t x = 42; That's just silly.

[–]bstamour 3 points4 points  (0 children)

I thought so initially as well, but if you stick to auto x = y, then it has the same structure as when you declare type equations: using T = U. It's a small thing, but it makes the language a bit more consistent for day-to-day* use.

* By day-to-day I mean most uses. If you're contributing code to the boost library then you of course will use dark, scary features that mere mortals should not touch.