title: c++ 11: why I recive the error : no matching function for call std::thread::thread?
body: <p>I wrote this function for implement multithrading, I recive this error and I don't understand why and how to fix it.
  I'm testing c++11 threads with this code, but when creating the thread, I'm having the error no matching function for call to 'std::thread::thread()'.
  I think that the problem is in how I call the function in thread, but I can't see what is wrong, it looks good to me.</p>
  
  <pre><code>    void Data::Set( const BeBoard* pBoard, const std::vector&lt;uint32_t&gt;&amp; pData, uint32_t pNevents, bool swapBytes )
      {
          std::vector&lt;uint32_t&gt; cVectorCopy;
          cVectorCopy = deepCopy( pData );
  
          std::thread cThreads[2];
          for ( int i = 0; i &lt; 2; ++i )
          {
              cThreads[0] = std::thread( Data::writeFile, cVectorCopy, "outputfile" );
  
              cThreads[1] = std::thread( Data::SetSpecialized, pBoard, pData, pNevents, swapBytes );
              for ( int i = 0; i &lt; 2; ++i )
                  cThreads[i].join();
          }
  </code></pre>
  
  <p>the functions called </p>
  
  <pre><code>    void Data::writeFile( std::vector&lt;uint32_t&gt; fData , std::string fFileName )
      {
  
          //check if the file already exists
          if ( boost::filesystem::exists( fFileName + ".bin" ) )
              remove( ( fFileName + ".bin" ).c_str() );
  
  
  
  
          std::ofstream ofile( ( fFileName + ".bin" ).c_str(), std::ios::binary );
  
          //write the bin file
          for ( auto&amp; cElements : fData )
              ofile.write( ( char* ) &amp;cElements, sizeof( uint8_t ) );
  
  
  
  
  
  
      }
  
  
      void Data::SetSpecialized( const BeBoard* pBoard, const std::vector&lt;uint32_t&gt;&amp; pData, uint32_t pNevents, bool swapBytes )
      {
  
  // just do a swap of the bytes
  
      }
  </code></pre>
  
  <p>And now the output:</p>
  
  <pre><code>&lt;pre&gt;&lt;code&gt;
  
  Data.cc: In member function ‘void Ph2_HwInterface::Data::Set(const Ph2_HwDescription::BeBoard*, const std::vector&lt;unsigned int&gt;&amp;, uint32_t, bool)’:
  Data.cc:38:74: error: no matching function for call to ‘std::thread::thread(&lt;unresolved overloaded function type&gt;, std::vector&lt;unsigned int&gt;&amp;, const char [11])’
      cThreads[0] = std::thread( Data::writeFile, cVectorCopy, "outputfile" );
  
  Data.cc:38:74: note: candidates are:
  In file included from ../Utils/Data.h:22:0,
                   from Data.cc:12:
  /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/thread:133:7: note: std::thread::thread(_Callable&amp;&amp;, _Args&amp;&amp; ...) [with _Callable = void (Ph2_HwInterface::Data::*)(std::vector&lt;unsigned int&gt;, std::basic_string&lt;char&gt;); _Args = {std::vector&lt;unsigned int, std::allocator&lt;unsigned int&gt; &gt;&amp;, const char (&amp;)[11]}]
         thread(_Callable&amp;&amp; __f, _Args&amp;&amp;... __args)
         ^
  /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/thread:133:7: note:   no known conversion for argument 1 from ‘&lt;unresolved overloaded function type&gt;’ to ‘void (Ph2_HwInterface::Data::*&amp;&amp;)(std::vector&lt;unsigned int&gt;, std::basic_string&lt;char&gt;)’
  /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/thread:128:5: note: std::thread::thread(std::thread&amp;&amp;)
       thread(thread&amp;&amp; __t) noexcept
       ^
  /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/thread:128:5: note:   candidate expects 1 argument, 3 provided
  /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/thread:122:5: note: std::thread::thread()
       thread() noexcept = default;
       ^
  /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/thread:122:5: note:   candidate expects 0 arguments, 3 provided
  Data.cc:40:88: error: no matching function for call to ‘std::thread::thread(&lt;unresolved overloaded function type&gt;, const Ph2_HwDescription::BeBoard*&amp;, const std::vector&lt;unsigned int&gt;&amp;, uint32_t&amp;, bool&amp;)’
      cThreads[1] = std::thread( Data::SetSpecialized, pBoard, pData, pNevents, swapBytes );
  
  
  &lt;/pre&gt;&lt;/code&gt;
  </code></pre>