I have a code that looks like this
class foo
{
public:
foo();
~foo();
int process();
};
int main()
{
foo myfoo1;
foo myfoo2;
std::thread firstthread(myfoo1.process());
std::thread secondthread(myfoo2.process());
return 0;
}
This is the error that I am getting
'std::invoke': no matching overloaded function found Disparity
I know that compiler is complaining because process()
is not static
but this involves making major changes to the class and I would like not to go that route. Any other hint on how to start the tread?
I cannot do
std::thread firstthread(&foo::process,foo() );
because myfoo1
is different that myfoo2
...