title: No match for call while launching thread on constructor
body: <p>I have a <code>class Foo</code>, that must launch a thread (which is a method <code>loop()</code> on my class) on the constructor.</p>
  
  <p>My class is something like this on the header file:</p>
  
  <pre><code>class Foo
  {
  public:
    Foo();
    ~Foo();
  private
    void loop();
  
    std::thread m_thread;
  
    //more stuff.
  }
  </code></pre>
  
  <p>And the source file is:</p>
  
  <pre><code>Foo::Foo()
  {
     m_thread(&amp;Foo::loop, Foo()); // &lt;---- No match for call '(std::thread) (void (Foo::*)(), Foo)'
     m_thread.join();
  }
  
  Foo::~Foo()
  {
    m_thread.kill(); // &lt;---- ??? how to do this?
  }
  
  void Foo::loop()
  {
     while()
     {
         //do stuff.
     }
  }
  </code></pre>
  
  <p><strong>Question:</strong></p>
  
  <p><strong>1 -</strong> How can I fix the error on the <code>Foo constructor</code>? I'm having the <code>"no match for call</code>" error when compiling. </p>
  
  <p>Bonus question:</p>
  
  <p><strong>2 -</strong> How can I kill the thread on the destructor of the object?</p>