From ea92ee8e1551ead4186fa4e65c33a87a3b558a52 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 16 May 2015 18:22:46 +0200 Subject: QList: partially revert ab8366b5923ec0feb730df98040885669f7bbe38 That commit removed the user-defined copy constructors, under the assumption that this would be ok for these non-exported classes. But the change is still BiC, because it turns the iterators into trivial types, which changes the way they are passed into functions by value. So, delay the change until Qt 6. Change-Id: I8065ff1ff78f5722505328447f2496777d1e8957 Reviewed-by: Konstantin Ritt Reviewed-by: Thiago Macieira Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/tools/qlist.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/corelib/tools/qlist.h') diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 1e002633df..e446a6625b 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -221,6 +221,11 @@ public: inline iterator() : i(0) {} inline iterator(Node *n) : i(n) {} +#if QT_VERSION < QT_VERSION_CHECK(6,0,0) + // can't remove it in Qt 5, since doing so would make the type trivial, + // which changes the way it's passed to functions by value. + inline iterator(const iterator &o): i(o.i){} +#endif inline T &operator*() const { return i->t(); } inline T *operator->() const { return &i->t(); } inline T &operator[](difference_type j) const { return i[j].t(); } @@ -268,6 +273,11 @@ public: inline const_iterator() : i(0) {} inline const_iterator(Node *n) : i(n) {} +#if QT_VERSION < QT_VERSION_CHECK(6,0,0) + // can't remove it in Qt 5, since doing so would make the type trivial, + // which changes the way it's passed to functions by value. + inline const_iterator(const const_iterator &o): i(o.i) {} +#endif #ifdef QT_STRICT_ITERATORS inline explicit const_iterator(const iterator &o): i(o.i) {} #else -- cgit v1.2.3