在C ++中,std :: multiset保持稳定的排序顺序? [英] In C++ does std::multiset keep a stable sorting order?

查看:254
本文介绍了在C ++中,std :: multiset保持稳定的排序顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有两个项目,a和b,比较它们。因此, b是假,并且b < a是假的。如果这些项被插入std :: multiset(或std :: multimap)作为键,我有任何保证他们的最终排序顺序吗?

Suppose I have two items, a and b, that compare the same. So a < b is false, and b < a is false. If these items are inserted into a std::multiset (or std::multimap) as keys, do I have any guarantees of their final sorted order?

检查了几个引用,但我找不到答案。

I've checked a couple of references, but I couldn't find the answer. I'm tempted to think that there are no guarantees and that it's left up to each particular implementation.

非常感谢。

推荐答案

这个主题意味着它不是由当前标准保证,但是由所有已知的当前实现来满足,并且给出包括保证的C ++ 0x草案标准的链接。

This thread implies that it is not guaranteed by the current standard but is met by all known current implementations, and gives a link to the C++0x draft standard that includes a guarantee.

这篇关于在C ++中,std :: multiset保持稳定的排序顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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