Here\'s the relevant code and the relevant error, I\'m not really sure what to make of it.
Breaker::Thread::Thread(std::string name, std::string desc, void*
I think the problem is the declaration of the parameter func
. It is declared as a void pointer instead of a pointer to a function returning void.
Instead of,
Breaker::Thread::Thread(std::string name, std::string desc, void* func)
I think you mean,
Breaker::Thread::Thread(std::string name, std::string desc, void (*func) ())
Note, loop
must be a static member for this to work.
Additionally, you might want to consider using std::function. It's a much more modern and cleaner interface than using void pointers.
Breaker::Thread::Thread(std::string name, std::string desc, std::function<void()> func)