progschj / ThreadPool

A simple C++11 Thread Pool implementation
zlib License
7.63k stars 2.21k forks source link

A simple problem about enqueue() #101

Open jinyunshaobing opened 1 year ago

jinyunshaobing commented 1 year ago

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.

ketop commented 1 year ago

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