Hacker News new | ask | show | jobs
by zmmmmm 4417 days 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-sta...