stl 排序 - 严格弱排序 [英] stl ordering - strict weak ordering

查看:19
本文介绍了stl 排序 - 严格弱排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么 STL 使用 严格弱排序的比较函数?为什么不能偏序?

Why does STL work with a comparison function that is strict weak ordering? Why can't it be partial ordering?

推荐答案

A 部分顺序不足以实现某些算法,例如排序算法.由于偏序集合不一定定义集合中所有元素之间的关系,那么如何对偏序内没有顺序关系的两个项目的列表进行排序?

A partial order would not be sufficient to implement some algorithms, such as a sorting algorithm. Since a partially ordered set does not necessarily define a relationship between all elements of the set, how would you sort a list of two items that do not have an order relationship within the partial order?

这篇关于stl 排序 - 严格弱排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆