0
Public Class Methods in Threads
How can you create a thread of a Class method?Creating a thread is like this "thread thr(func);" You just pass in a function pointer. But doing this with a method doesn't work "thread thr(obj.method);" What should I do?
3 ответов
+ 1
depends on language.... At example in java you can pass to Thread ctor an Runnable implementer child where work of thread is defined in run() method
+ 1
I dont know much new C++ standard but seem that using std:thread you have to use function only for multithreading... Anyway you can start thread directly inside the method
0
Cpp?