Skip to content

Instantly share code, notes, and snippets.

@euler0
Created November 8, 2011 06:08
Show Gist options
  • Save euler0/1347132 to your computer and use it in GitHub Desktop.
Save euler0/1347132 to your computer and use it in GitHub Desktop.
using namespace std;
list<int> my_list;
...
// Range-based for-loop (C++11)
for_each (int x : my_list) {
cout << x << endl;
}
// for each, in (Visual Studio 2005+, non-standard)
for each (int x in my_list) {
cout << x << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment