In below code, at thread t(&Fred::hello)
i am getting an error that the term does not evaluate to a function taking 0 arguments. What is the issue?
#include <iostream>
#include <thread>
using namespace std;
class Fred
{
public:
virtual void hello();
};
void Fred::hello()
{
cout << "hello" << endl;
}
int main()
{
thread t (&Fred::hello);
t.join();
return 0;
}