2 ms·
Counting headers is rather unfair. C++11: map<int, char> x = {{1, 'a'}, {3, 'b'}, {5, 'c'}, {7, 'd'}}; Any not-ancient C++ using boost Assign: map<int, char
by zmmmmm 13y ago
Counting headers is rather unfair.
C++11:
map<int, char> x = {{1, 'a'}, {3, 'b'}, {5, 'c'}, {7, 'd'}};
Any not-ancient C++ using boost Assign:
map<int, char> x = map_list_of (1, 'a') (3, 'b') (5, 'c') (7, 'd');
Shamelessly stolen from here:
http://stackoverflow.com/questions/138600/initializing-a-static-stdmapint-int-in-c http://stackoverflow.com/questions/138600/initializing-a-sta...