TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C++ Coding Standard
Search

Rule:  CFL#018Checked automatically with code checker

Synopsis:Use range-based for loops instead of iterators
Language:C++
Severity Level:4
Category:Control Flow


Description:

Wrong Example:

std::vector<char> myString;
for (auto iter = myString.begin(); iter != myString.end(); iter++)

Correct Example:

std::vector<char> myString;
for (auto & value : myString)