Support C++ initializer lists: std::vector<double> v = { 1, 2, 3.456, 99.99 };
See http://www2.research.att.com/~bs/C++0xFAQ.html#init-list
Some examples:
vector<double> v = { 1, 2, 3.456, 99.99 };
list<pair<string,string>> languages = {
{"Nygaard","Simula"}, {"Richards","BCPL"}, {"Ritchie","C"}
};
map<vector<string>,vector<int>> years = {
{ {"Maurice","Vincent", "Wilkes"},{1913, 1945, 1951, 1967, 2000} },
{ {"Martin", "Ritchards"} {1982, 2003, 2007} },
{ {"David", "John", "Wheeler"}, {1927, 1947, 1951, 2004} }
};
2 comments
-
Riccardo Marcangelo
commented
Forget my last comment. initializer_list is not present in the Visual Studio 11 Developer Preview.
-
Riccardo Marcangelo
commented
I assume this will be implemented as VC++ 11 will want to be as standard conforming as possible with the new C++11 standard.