1
vote
Vote UpVote

My top 5 C++11 language features #4 - range-based for loop

JT @ Embarcadero – Following up on yesterdays discussion of the new auto keyword, my #4 top new C++11 feature is the ranged-based for loop. A range-based for loop basically allows a C++ developer to iterate through a collection of data and automatically provide a reference to the indexed data. Let’s take a look at the example of iterating through a vector of ints from yesterday. for(auto fi = vi.begin(); fi != vi.end(), ++fi) auto i = *fi; std::cout << i; As we learned yesterday, using auto really simplifies the code needed to iterate through an STL container but notice that we still need to check ...
Favorite? Off-Topic? J T @ 2012-11-13 20:39

Statistics

Visits: 671
Votes: 1
Favorites: 1
Off-Topic: 4

Visits by Source

User Actions

Users who voted for this posting

stukelly
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)