2021年4月14日

摘要: map默认是按key值从小到大排序的 按value值排序: 想直接用sort排序是做不到的,sort只支持数组、vetctor等的排序,所以我们可以先把map装进pair里,然后再放入vector,自定义sort实现排序 假设已有一组map<string,int>类型的数mp,则具体实现过程为: v 阅读全文
posted @ 2021-04-14 19:58 tycoon3 阅读(358) 评论(0) 推荐(0)
摘要: #include <iostream> #include <thread> int main() { int id = 9; std::thread t([&id](){ std::cout << "thread function and id " << id << std::endl; }); s 阅读全文
posted @ 2021-04-14 16:16 tycoon3 阅读(53) 评论(0) 推荐(0)
摘要: 一. 前言 本文总结std库中unsorted_map和map的区别。 二. 区别示意图map unordered_mapOrdering increasing order ( by default ) no orderingImplementation Self balancing BST ( l 阅读全文
posted @ 2021-04-14 14:32 tycoon3 阅读(962) 评论(0) 推荐(0)

导航