I know there exists this question and this one as well. I have gone through both of them and haven't been able to solve my problem. I was able to run examples for class member functions that take zero arguments, but was not able to deduce what the constructor for the thread would look like in case the member function had arguments.
I have a class A. A has a member function f that takes 2 parameters p1 and p2. I have instantiated an object a of class A. I want to call the function f in a thread.
From cppreference.com :
template< class Function, class... Args >
explicit thread( Function&& f, Args&&... args );
is how I must write the constructor.
I am having trouble deciphering the above definition. How can I call a.f(p1,p2) defined as
void A::f(int p1, int p2)
in a thread ?