微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

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是正式鼓励的,如果它成为必需品.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐