Work around old Clang bug parsing of NSDMI referring to members

Clang pre-3.4 didn't like this and it's used in Xcode 5.1 (which we need
to support for 5.8).

error: 'this' cannot be implicitly captured in this context
    typename T::const_iterator i = c.begin(), e = c.end();
                                   ^

Task-number: QTBUG-57488
Change-Id: I63e21df51c7448bc8b5ffffd148e688d7c9b89d6
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Thiago Macieira 2016-12-08 14:31:24 -08:00 committed by Jani Heikkinen
parent d8b678661b
commit 9f96e4f431

View File

@ -921,10 +921,10 @@ template <typename T>
class QForeachContainer {
QForeachContainer &operator=(const QForeachContainer &) Q_DECL_EQ_DELETE;
public:
QForeachContainer(const T &t) : c(t) {}
QForeachContainer(T &&t) : c(std::move(t)) {}
QForeachContainer(const T &t) : c(t), i(c.begin()), e(c.end()) {}
QForeachContainer(T &&t) : c(std::move(t)), i(c.begin()), e(c.end()) {}
const T c;
typename T::const_iterator i = c.begin(), e = c.end();
typename T::const_iterator i, e;
int control = 1;
};