Skip to content

Instantly share code, notes, and snippets.

@deibit
Created January 7, 2012 21:15
Show Gist options
  • Save deibit/1576066 to your computer and use it in GitHub Desktop.
Save deibit/1576066 to your computer and use it in GitHub Desktop.
new auto and for...
// $clang++ --std=c++0x --stdlib=libc++ newfor.cpp -o newfor
#include <vector>
#include <iostream>
using namespace std;
int main()
{
auto v = vector<int>();
v.push_back(1);
v.push_back(2);
for(int z:v)
{
cout << z << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment