summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qvariant.h
diff options
context:
space:
mode:
authorEric Lemanissier <eric.lemanissier@gmail.com>2018-03-05 16:59:11 +0100
committerEric Lemanissier <eric.lemanissier@gmail.com>2018-03-06 22:04:37 +0000
commit2869bf9f1ea05d07d7e30b669cf67f71d17ad29f (patch)
treef55bd72a0978ffa4e0ca81fd70160e1aaf94544b /src/corelib/kernel/qvariant.h
parentada1b61991b16f21c5cd9c785dc7fbfa832f18be (diff)
implement non-member operator+ for iterators
all of these iterator classes already have a member operator+, which allows iter+int. This commits addes non-member operator+, which allows int+iter, and forwards to the member QList and QArrayData iterators now satisfy RandomAccessIterator concept Change-Id: I25c1dd8cea299e735d5a5e288dbe23dc1d7a1933 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qvariant.h')
-rw-r--r--src/corelib/kernel/qvariant.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index fe1ef1bdfc..b515dfa099 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -627,6 +627,7 @@ public:
const_iterator &operator-=(int j);
const_iterator operator+(int j) const;
const_iterator operator-(int j) const;
+ friend inline const_iterator operator+(int j, const_iterator k) { return k + j; }
};
friend struct const_iterator;
@@ -684,6 +685,7 @@ public:
const_iterator &operator-=(int j);
const_iterator operator+(int j) const;
const_iterator operator-(int j) const;
+ friend inline const_iterator operator+(int j, const_iterator k) { return k + j; }
};
friend struct const_iterator;