title: C++11 std::thread giving error: no matching function to call std::thread::thread
body: <p>I'm testing c++11 threads with this code, but when creating the thread, I'm having the error <strong>no matching function for call to 'std::thread::thread()'</strong>.</p>
  
  <p>It's like if there was something wrong with the function I'm giving to std::thread ctr, but I don't see how it's wrong. It is incompleted, but it looks right to me:</p>
  
  <p>Header:</p>
  
  <pre><code>#ifndef CONNECTION_H
  #define CONNECTION_H
  
  #include &lt;thread&gt;
  #include &lt;mysql++.h&gt;
  
  class Connection
  {
  public:
      Connection(std::string mysqlUser, std::string mysqlPassword);
      ~Connection();
  
  private:
      std::string mysqlUser;
      std::string mysqlPassword;
      std::string mysqlIP;
      int mysqlPort;
  
      mysqlpp::Connection mysqlConnection;
      std::thread connectionThread;
  
      void threadLoop();
  };
  
  #endif // CONNECTION_H
  </code></pre>
  
  <p>Source:</p>
  
  <pre><code>#include "connection.h"
  
  Connection::Connection(std::string mysqlUser, std::string mysqlPassword)
  {
      this-&gt;mysqlUser     = mysqlUser;
      this-&gt;mysqlPassword = mysqlPassword;
      this-&gt;mysqlIP       = "localhost";    //default
      this-&gt;mysqlPort     = 3306;           //default
  
      //Launch thread
      std::thread connectionThread(threadLoop);
  
  }
  
  Connection::~Connection(){
      mysqlConnection.disconnect();
  }
  
  void Connection::threadLoop(){
      //Connect to mySQL database
      mysqlConnection = new mysqlpp::Connection(false);
  
      if(mysqlConnection.connect(NULL, mysqlIP.c_str(), mysqlUser.c_str(), mysqlPassword.c_str(), mysqlPort)){
          std::string consulta = "SELECT * FROM 'Coordinates'";
          mysqlpp::Query query = mysqlConnection.query(consulta);
          mysqlpp::StoreQueryResult res = query.store();
          query.reset();
  
      }
  
      while(true){
          // Stuff
      }
  }
  </code></pre>