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前面。
需要重载()运算符。参考链接里的用法。
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前面。
需要重载()运算符。参考链接里的用法。