how to pass <std::function<void(int)>> paramater in c++ : <p>i'm trying to perform a thread pool design pattern in c++, but i'm stuck on passing a task  function parameter in order to push it inside a list 
here is my code </p>

<pre><code>  std::list&lt;std::function&lt;void(int)&gt;&gt; work_queue; 
</code></pre>

<p>my push function</p>

<pre><code> void pushTask(std::function&lt;void(int)&gt; func , int a) 
{ 
std::unique_lock&lt;std::mutex&gt; lck(wq_mutex);
work_queue.push_back(std::function&lt;void(int)&gt;(func),a));
 }   
</code></pre>

<p>and here my main function with the task functin </p>

<pre><code>void calcul(int a){
std::cout &lt;&lt; a &lt;&lt; "\n";
}

int main(){
ThreadPool th(10);
th.pushTask(std::bind(&amp;calcule,4));
return 0;
</code></pre>

<p>}</p>

<p>i getting an error in this line </p>

<pre><code>   work_queue.push_back(std::function&lt;void(int)&gt;(func),a));
</code></pre>

<p>can anyone identify the issue please ?</p>
