Last active
August 29, 2015 14:21
-
-
Save jerinphilip/39405bd34619d3f7010b to your computer and use it in GitHub Desktop.
C++ 11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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