title: Template function will not compile when called as a thread
body: <p>I have a problem relating to template functions and threads:</p>
  
  <pre><code>template &lt;class TYPE_size&gt;
  void Threader(TYPE_size counter)
  {
      counter++;
  }
  int main()
  {
      unsigned int counter = 100;
      thread one(Threader,counter);
      one.join();    
      cout &lt;&lt; counter;
  }
  </code></pre>
  
  <p>This does not compile; I get:</p>
  
  <blockquote>
    <p>error: no matching function for call to
    âstd::thread::thread(, unsigned
    int&amp;)â</p>
  </blockquote>
  
  <p>If I remove the template it compiles and if I change the function call to a standard function call rather than a thread (still using the template) it compiles.</p>
  
  <p>Does anyone know why this is?</p>
  
  <p>I'm using Centos5 64 bit.</p>
  
  <pre><code> error: no matching function for call to âstd::thread::thread(&lt;unresolved overloaded function type&gt;, unsigned int&amp;)â
  /usr/lib/gcc/x86_64-redhat-linux6E/4.4.0/../../../../include/c++/4.4.0/thread:124: note: candidates are: std::thread::thread(std::thread&amp;&amp;)
  /usr/lib/gcc/x86_64-redhat-linux6E/4.4.0/../../../../include/c++/4.4.0/thread:122: note:                 std::thread::thread(const std::thread&amp;)
  /usr/lib/gcc/x86_64-redhat-linux6E/4.4.0/../../../../include/c++/4.4.0/thread:121: note:                 std::thread::thread()
  </code></pre>