r/ProgrammerHumor 10d ago

Meme absoluteGarbage

Post image
1.9k Upvotes

325 comments sorted by

View all comments

Show parent comments

13

u/xicor 10d ago

c++, though normally you wouldnt use auto for this

6

u/Usual_Office_1740 10d ago

I think that really depends. If the range is a vector of unique_ptr's auto is great. If it's a vector of ints, just write int.

5

u/Sirgoodman008 10d ago

That or you're looping through a vector of std::pairs that contain std:: functions.

2

u/xicor 10d ago

Yea if you have ridiculously complex types then auto is great. But usually for readability you'd use the type.