[Solved] Using function members in functionals in c++ [closed]


First of all continue is an already occupied keyword, so, better rename your function.

The continue statement shall occur only in an iteration-statement and causes control to pass to the loop-continuation portion of the smallest enclosing iteration-statement, that is, to the end of the loop.

In our case, you trying to use a non-static member function as a static. To fix it, you can use lambda runLoop([this] { return your_func_name(); });

P.S. you will still get errors because you have uninitialized ref-member and you miss ; after class definition.

solved Using function members in functionals in c++ [closed]