C++ 字面量
C++中的字典字面量
You can actually do this:
std::map<std::string, int> mymap = {{"one", 1}, {"two", 2}, {"three", 3}};
What is actually happening here is that std::map stores an std::pair of the key value types, in this case std::pair
So unlike python's any class you create can use this syntax to initialize itself as long as you create a constructor that takes an initializer list (or uniform initialization syntax is applicable)
https://stackoverflow.com/a/20230177/1061155