fixed new compiler error due to MSVC incorrect handling of

capturing the this pointer in a lambda inside another lambda
This commit is contained in:
Mathew Sutcliffe
2014-03-26 13:34:13 +00:00
parent fd926b867d
commit cf10f9cc35

View File

@@ -87,12 +87,13 @@ public:
template <class F1, class F2> ExpectUnit& expect(F1 signal, F2 slot)
{
auto subj = subject<F1>();
auto next = [=]{ this->next(); };
m_expects.push_back([=]{
m_waitingFor = subj->metaObject()->className();
m_waitingFor += "::";
m_waitingFor += QMetaMethod::fromSignal(signal).name();
m_guard += QObject::connect(subj, signal, slot);
m_guard += QObject::connect(subj, signal, [=]{ next(); });
m_guard += QObject::connect(subj, signal, next);
});
return *this;
}