Apr 5, 2015 at 7:59am
Could someone please explain to me in detail how this works. for(int x : y). Basically the use of the colon, ':'.
Apr 5, 2015 at 8:09am
1 2 3 4 5
|
for(auto it = std::begin(y); it != std::end(y); ++it)
{
int x = *it;
// inner for loop content ends up here
}
|
Last edited on Apr 5, 2015 at 8:09am
Apr 5, 2015 at 8:17am
Search the web with "C++11 range-based for-loop".