ThreadPool icon indicating copy to clipboard operation
ThreadPool copied to clipboard

A simple problem about enqueue()

Open jinyunshaobing opened this issue 3 years ago • 1 comments

How can i do this?

class A
{
public:
    void a(){
        ThreadPool pool(4);
        pool.enqueue(b);
    }
private:
    void b(){
        num++;
    }
    int num;
}

What i see is :No instance of function template 'ThreadPool::enqueue' matching argument list.

jinyunshaobing avatar Sep 07 '22 08:09 jinyunshaobing

pool.enqueue(&A::b, this);

ketop avatar Dec 03 '22 06:12 ketop