summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qarraydata.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-02-07 13:56:57 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-22 04:38:01 +0100
commit1c63909ad8caee11ba0ec4af998d981bd50d3ee1 (patch)
tree6c1ede83f1588b95ce0528f89b7ead0ec8dd2ac8 /src/corelib/tools/qarraydata.h
parentde5ae6917c819ff23f7d9c5742b50b15e0824877 (diff)
Make sure all containers compile in strict-iterator mode
Unit-test this by making the QList, QVector, QHash and QMap unit tests be duplicated under strict-iterator mode. There's no test for QLinkedList. The tst_Collections test does not compile under strict-iterator mode. It generated over 15000 errors when I tried. The strict iterators required a small change: the difference_type typedef needs to match the operators that get distances (operator-(iterator)) and move the iterator around (+, -, +=, -=, etc.). Task-number: QTBUG-29608 Change-Id: I834873934c51d0f139a994cd395818da4ec997e2 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
Diffstat (limited to 'src/corelib/tools/qarraydata.h')
-rw-r--r--src/corelib/tools/qarraydata.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h
index 7df4694bcd..ffb2b8765e 100644
--- a/src/corelib/tools/qarraydata.h
+++ b/src/corelib/tools/qarraydata.h
@@ -135,7 +135,7 @@ struct QTypedArrayData
public:
T *i;
typedef std::random_access_iterator_tag iterator_category;
- typedef qptrdiff difference_type;
+ typedef int difference_type;
typedef T value_type;
typedef T *pointer;
typedef T &reference;
@@ -169,7 +169,7 @@ struct QTypedArrayData
public:
const T *i;
typedef std::random_access_iterator_tag iterator_category;
- typedef qptrdiff difference_type;
+ typedef int difference_type;
typedef T value_type;
typedef const T *pointer;
typedef const T &reference;