Reader Q&A: auto and for loop index variables—Herb Sutter

Save to:
Instapaper Pocket Readability

Discussion on how to use/replace auto for loop index variables.

Reader Q&A: auto and for loop index variables

by Herb Sutter

From the reader's question:

So I’ve been reading all I can about c++11/c++14 and beyond when time permits.  I like auto, I really do, I believe in it.  I have a small problem I’m trying to decide what to do about.  So in old legacy code we have things like this:

for (int i = 0; i < someObject.size(); i++) { … }

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.