Попытка запустить несколько потоков с использованием экземпляра вектора потока. Аргументы потока включают functor и functor_arg. Но возникает ошибка: нет соответствующего конструктора для инициализации 'std::thread'.
#include
#include
#include
// Functor class that overloads the operator()
class Functor{
public:
// Operator overload to allow the object to be called as a function
void operator()(int id) { //The const here indicates that the functor
//does not modify the object's state or private variables
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79241707/creating-a-vector-of-threads-which-runs-a-functor-with-an-arg-getting-no-match[/url]
Попытка запустить несколько потоков с использованием экземпляра вектора потока. Аргументы потока включают functor и functor_arg. Но возникает ошибка: нет соответствующего конструктора для инициализации 'std::thread'. [code]#include #include #include
// Functor class that overloads the operator() class Functor{ public: // Operator overload to allow the object to be called as a function void operator()(int id) { //The const here indicates that the functor //does not modify the object's state or private variables std::cout