摘要: C++的函数也有类型。比如: void func(int a); 上面的函数的类型是: void(int) 它可以作为模板类型参数,如同普通的类型一样: template<typename T> Foo; Foo<void(int)> foo; std::function模板就有类似的用法。 我做了 阅读全文
posted @ 2021-12-10 14:48 Demon90s 阅读(281) 评论(0) 推荐(0)
摘要: 在之前的一篇博客中,讨论了如何合并两个排行榜。 https://www.cnblogs.com/demon90s/p/15659594.html 但代码上有一些瑕疵,就是排序的规则写得异常的简陋: std::sort(tmp_list.begin(), tmp_list.end(), [](cons 阅读全文
posted @ 2021-12-10 00:31 Demon90s 阅读(136) 评论(0) 推荐(0)