[C++][Visual Studio]Visual studio 2010 C++0x new feature: auto
#include “stdafx.h” #include <string> #include <list> #include <map>
using namespace std;
int _tmain(int argc, _TCHAR* argv[]) { auto x = 1, *y = &x, **z = &y; // Resolves to int. auto a(2.01), *b (&a); // Resolves to double. auto c = ‘a’, *d(&c); // Resolves to char. auto m = 1, &n = m; // Resolves to int.
map<int,list<string>> mapObj;
map<int,list<string>>::iterator i1 = mapObj.begin();
auto i2 = mapObj.begin();
auto lambda = []()->int
{
return 0;
};
return 0;
}