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

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

问题描述

为什么STL工作,一个比较函数是严格弱序?为什么不能是偏序?

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

推荐答案

一个部分订单不会足以实现一些算法,如一个排序算法。由于偏序集并不能确定集合的所有元素之间的关系,你会怎么排序的两个项目的列表没有偏序中的次序关系?

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天全站免登陆