title: Thread Pool compile error
body: <p>When i try to compile my thread pool with one task i got following error :</p>
  
  <blockquote>
    <p>error: 'void ThreadPool::enqueue(F) [with F =
    CConnection::handle()::]', declared using local type
    'CConnection::handle()::', is used but never defined
    [-fpermissive]</p>
  </blockquote>
  
  <p>Here is thread pool declaration :</p>
  
  <pre><code>class ThreadPool {
  public:
      ThreadPool(size_t);
      template&lt;class F&gt;
      void enqueue(F f);
      ~ThreadPool();
  private:
      // need to keep track of threads so we can join them
      std::vector&lt; std::unique_ptr&lt;boost::thread&gt; &gt; workers;
  
      // the io_service we are wrapping
      boost::asio::io_service service;
      boost::asio::io_service::work working;
      friend class Worker;
  };
  </code></pre>
  
  <p>Here is function, what want to use thread pool to test :</p>
  
  <pre><code>void CConnection::handle()
  {
       ThreadPool pool(4);
       pool.enqueue([1]
      {
          std::cout &lt;&lt; "hello " &lt;&lt; 1 &lt;&lt; std::endl;
          boost::this_thread::sleep(
              boost::posix_time::milliseconds(1000)
          );
          std::cout &lt;&lt; "world " &lt;&lt; 1 &lt;&lt; std::endl;
      });
       char * databuffer;
       databuffer = new char[16];
       for(int i = 0;i&lt;16;i++)
       {
        databuffer[i] = 0x00;
       }
       databuffer[0] = 16;
       databuffer[4] = 1;
       databuffer[8] = 1;
       databuffer[12] = 1;
       asynchronousSend(databuffer, 16);
  
  }
  </code></pre>
  
  <p>And here is enqueue definition :</p>
  
  <pre><code>template&lt;class F&gt;
  void ThreadPool::enqueue(F f)
  {
      service.post(f);
  }
  </code></pre>
  
  <p>Can some one found what I doing wrong ?</p>