std::sort用法 c++

http://www.cplusplus.com/reference/algorithm/sort/

需要包含头文件

#include <algorithm>

std::sort(Iterator first, Iterator second, Compare comp);

排序范围【first, second) 含前不含后
comp(a, b) 返回true,则a排在b前面。

需要重载()运算符。参考链接里的用法。


原文地址:https://www.cnblogs.com/min2day/p/14509206.html