I have C++14 enabled in a code (a Qt5 project) similar to the following:
auto func = [&](auto p, auto pp) {
if(!p)
return;
pp = p;
p->init();
};
MyClass *p1;
...
func(p1, m_p);
m_p->doSomething();
After receiving:
internal compiler error: Segmentation fault
Debugging I found m_p
did not change after the call to func
, as I was expecting. Does generic templates (auto) really works so? How do I go to change m_p in a code like that?
Aucun commentaire:
Enregistrer un commentaire