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

相关文章

本程序的编译和运行环境如下(如果有运行方面的问题欢迎在评...
水了一学期的院选修,万万没想到期末考试还有比较硬核的编程...
补充一下,先前文章末尾给出的下载链接的完整代码含有部分C&...
思路如标题所说采用模N取余法,难点是这个除法过程如何实现。...
本篇博客有更新!!!更新后效果图如下: 文章末尾的完整代码...
刚开始学习模块化程序设计时,估计大家都被形参和实参搞迷糊...