A Server Class Taking Any Function To Run in Thread With Passing a Server-Generated Value
问题 I am trying to write a server class with a method that takes a function as an argument and pass in a value (generated inside the server class) to the function for being run inside a thread. The following is just an example to illustrate what I am trying to do. My goal is to have the Server::runFunctionInThread general enough that works for methods of different classes as well as for functions that do not belong to any classes. Is this a possible thing to do? #include <iostream> #include