I am trying to start a new thread everytime when ObjParser::loadData() is called like they did it in this example.
So I wrote this code.
#include <thread>
void ObjParser::loadData()
{
thread loadingThread(_loadData);
loadingThread.detach();
}
void ObjParser::_loadData()
{
//some code
}
But when I try to compile it I get this error:
error C3867: 'ObjParser::_loadData': function call missing argument list; use '&ObjParser::_loadData' to create a pointer to member
So I created a pointer to the member function:
#include <thread>
void ObjParser::loadData()
{
thread loadingThread(&ObjParser::_loadData);
loadingThread.detach();
}
void ObjParser::_loadData()
{
//some code
}
But then the compiler complaines:
error C2064: term does not evaluate to a function taking 0 arguments
I have no ideas what causes the problem, could you please give me a hint how to solve this problem.