有没有人知道有没有办法让我可以将地图顺序从"更少"改为"更多"?
例如:
有一个map<string, int>叫test.我插入一些条目:
map<string, int>
test
test["b"] = 1; test["a"] = 3; test["c"] = 2;
在地图内,订单将是(a, 3)(b, 1)(c, 2).
(a, 3)(b, 1)(c, 2)
我想要它(c, 2)(b, 1)(a, 3).
(c, 2)(b, 1)(a, 3)
我怎么能这么简单地做到这一点?
c++ map
c++ ×1
map ×1