Consider the following code:
class A
{
....
shared_ptr<std::thread> mThread;
void Step();
void LaunchTrhead();
}
void A::LaunchThread()
{
...
mThread=make_shared<std::thread>(Step); // This line gives an error
...
}
void A::Step()
{
...
}
I'm trying to initialise the shared pointer mThread so that it calls the function Step. However, the compiler gives me the error "invalid initialization of reference of type ... from expression of type 'unresolved overloaded function type'". Obviously I'm doing something stupid, but I can't put my finger on it. Can anybody help? Thanks in advance!