Skip to content

Instantly share code, notes, and snippets.

@jerinphilip
Last active August 29, 2015 14:21
Show Gist options
  • Save jerinphilip/39405bd34619d3f7010b to your computer and use it in GitHub Desktop.
Save jerinphilip/39405bd34619d3f7010b to your computer and use it in GitHub Desktop.
C++ 11
//static initialization of containers
vector <int> V = {1, 2, 3};
pair <int, int> p = {1, 2};
map <int, string> M = {
{0, "Hello"},
{1, "World"}
};
//Type inference
auto x = V.begin();
auto y = 3;
//Range based for loops
for ( auto i : V )
cout<<i<<endl;
for ( auto& i : V)
i = i*2;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment