diff options
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qglobal.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index e6d65b0f99..c463a392b7 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -943,10 +943,11 @@ template <typename T> class QForeachContainer { QForeachContainer &operator=(const QForeachContainer &) Q_DECL_EQ_DELETE; public: - inline QForeachContainer(const T& t) : c(t), i(c.begin()), e(c.end()), control(1) { } + QForeachContainer(const T &t) : c(t) {} + QForeachContainer(T &&t) : c(std::move(t)) {} const T c; - typename T::const_iterator i, e; - int control; + typename T::const_iterator i = c.begin(), e = c.end(); + int control = 1; }; // Explanation of the control word: |