summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/global/qforeach.h20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/corelib/global/qforeach.h b/src/corelib/global/qforeach.h
index 95d68f31e4..80d0c41aa2 100644
--- a/src/corelib/global/qforeach.h
+++ b/src/corelib/global/qforeach.h
@@ -21,31 +21,13 @@ namespace QtPrivate {
template <typename T>
class QForeachContainer {
- Q_DISABLE_COPY(QForeachContainer)
+ Q_DISABLE_COPY_MOVE(QForeachContainer)
public:
QForeachContainer(const T &t) : c(t), i(qAsConst(c).begin()), e(qAsConst(c).end()) {}
QForeachContainer(T &&t) : c(std::move(t)), i(qAsConst(c).begin()), e(qAsConst(c).end()) {}
- QForeachContainer(QForeachContainer &&other)
- : c(std::move(other.c)),
- i(qAsConst(c).begin()),
- e(qAsConst(c).end()),
- control(std::move(other.control))
- {
- }
-
- QForeachContainer &operator=(QForeachContainer &&other)
- {
- c = std::move(other.c);
- i = qAsConst(c).begin();
- e = qAsConst(c).end();
- control = std::move(other.control);
- return *this;
- }
-
T c;
typename T::const_iterator i, e;
- int control = 1;
};
// Containers that have a detach function are considered shared, and are OK in a foreach loop