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