加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c – 是否有QPair课程,但有三个而不是两个?

发布时间:2020-12-16 10:36:16 所属栏目:百科 来源:网络整理
导读:QPair很好,但如果我需要3件物品怎么办?我应该制作一个结构,还是Qt让我被覆盖? 解决方法 如 QTBUG-22441所示,开发人员无意添加std :: tuple的Qt模拟. (尽管 QTBUG-3283给了我们希望它可以完成,它的日期是09年12月,而新的报告,带有WONTFIX,是在2015年5月).因
QPair很好,但如果我需要3件物品怎么办?我应该制作一个结构,还是Qt让我被覆盖?

解决方法

如 QTBUG-22441所示,开发人员无意添加std :: tuple的Qt模拟. (尽管 QTBUG-3283给了我们希望它可以完成,它的日期是09年12月,而新的报告,带有WONTFIX,是在2015年5月).因此,您需要回退到std :: tuple或者提出自己的数据结构.

引自Marc Mutz:

A hypothetical QTuple wouldn’t do anything differently,anyway,except drain Qt developer resources.

此外,the docs for Qt 5 Algorithms module明确说明如下:

Historically,Qt used to provide functions which were direct equivalents of many STL algorithmic functions. Starting with Qt 5.0,you are instead encouraged to use directly the implementations available in the STL; most of the Qt ones have been deprecated (although they are still available to keep the old code compiling).

因此,在使用Qt 5进行编程时使用STL是正式鼓励的,如果它成为必需品.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读