Why does this C++ thread example not work?
<p>I am trying to compile the following example and I am getting an error. Below is the code :</p>

<pre><code>class A {
    private:
     //variables

    public:
      A(int a,int b){
        //assign variables
      }
      void C(){
         // do something
      }
       int D(){
       // do something
       }
       void E(){
       }
  }; 
 int main(){
    A* temp = new A(a,b);
    temp-&gt;C;
    std::thread t;
    t(&amp;A::D,A);
    t.join();
    temp-&gt;E;
    return 0;
 }
</code></pre>

<p>I get the following error when I compile the above code with <code>pthread</code> and <code>std=c++11</code> flags. The following is the error message :</p>

<pre><code>expected primary-expression before ‘)’ token
 t(&amp;A::D,A);
</code></pre>