Why do I get "no match for call" on this code?
<p>Let's see I want to do this, i want to get the parent of a tree, then sum the nodes and putthe result in the parent, this is multithreaded. I'm using a queue to stare the nodes   thata can be sum, etc.</p>

<p>The problem I'm facing is this</p>

<pre><code>error: no match for call to ‘(Triplets) (int&amp;, int&amp;, bool&amp;, NodeT*&amp;)’
</code></pre>

<p>The code is coming from is this </p>

<pre><code>void find_triplets(NodeT *ptrRoot)
{
   if (ptrRoot != NULL)
    {
    find_triplets(ptrRoot-&gt;left);
    find_triplets(ptrRoot-&gt;right);

    cout &lt;&lt; "find triplets and save them to the queue" &lt;&lt; endl;
        cout &lt;&lt; " we hit a hot spot is null the root, nothing to see here move along boys" &lt;&lt; endl;

     if(ptrRoot-&gt;left != NULL &amp;&amp; ptrRoot-&gt;right != NULL)
        {

        if (ptrRoot-&gt;left-&gt;done == true &amp;&amp; ptrRoot-&gt;right-&gt;done == true)
        {
        cout &lt;&lt; "we got one of 2 sons true so do something, this are the sons "
 &lt;&lt; ptrRoot-&gt;left-&gt;key_value &lt;&lt; " " &lt;&lt; ptrRoot-&gt;right-&gt;key_value &lt;&lt; endl;         

        cout &lt;&lt; "sum them and put it in the father and set it to true " &lt;&lt; endl;
        ptrRoot-&gt;key_value = ptrRoot-&gt;left-&gt;key_value + ptrRoot-&gt;right-&gt;key_value;
        ptrRoot-&gt;done = true;
        cout &lt;&lt; "thread queue " &lt;&lt; endl;
       triplet(ptrRoot-&gt;left-&gt;key_value, ptrRoot-&gt;right-&gt;key_value, ptrRoot-&gt;done, ptrRoot);
        qThreads.push(triplet);

        }
     }
        }
</code></pre>

<p>The triplet class is like so</p>

<pre><code>class Triplets
{
public:
  int nVal1;
  int nVal2;
  NodeT *ptrNode;
  bool bUpdate;

  Triplets()
  {
    nVal2 = 0;
    nVal1 = 0;
    bUpdate = false;
    ptrNode = NULL;
  }

  ~Triplets()
  {
    delete ptrNode;
  }

  Triplets(int nVal1, int nVal2, bool bUpdate, NodeT *ptrNode)
  {
    this-&gt;nVal2 = nVal2;
    this-&gt;nVal1 = nVal1;
    this-&gt;bUpdate = bUpdate;
    this-&gt;ptrNode = ptrNode;
  }

  void form_triplet(int nval1, int nVal2, bool bUpdate, NodeT *ptrNode)
  {
    this-&gt;nVal2 = nVal2;
    this-&gt;nVal1 = nVal1;
    this-&gt;bUpdate = bUpdate;
    this-&gt;ptrNode = ptrNode;
  }
};
</code></pre>

<p>So what I want to do is to store the actual object in the queue to modify it, and don't make copies of it. Thanks</p>
