title: Error: No instance of constructor matches the argument list
body: <p>As part of an assignment we have been asked to create a Vector3D class which uses memory allocated on the Heap. I have a Vector3DHeap class with the following constructor.</p>
  
  <pre><code>Vector3DHeap::Vector3DHeap(float&amp; x, float&amp; y, float&amp; z)
  {
      this-&gt;x = &amp;x;
      this-&gt;y = &amp;y;
      this-&gt;z = &amp;z;
  }
  </code></pre>
  
  <p>If I want to get a unit vector, I was expecting the be able to do the following. This gives the error message "No instance of constructor matches the argument list, argument types are (float, float, float).</p>
  
  <pre><code>Vector3DHeap* Vector3DHeap::getUnitVector()
  {
      float m = *getMagnitude();
  
      return new Vector3DHeap((*x / m), (*y / m), (*z / m));
  }
  </code></pre>
  
  <p>The compiler is happy if I define three float variables, a, b and c and pass these to the constructor. What is wrong with the code above?</p>
  
  <pre><code>Vector3DHeap* Vector3DHeap::getUnitVector()
  {
      float m = *getMagnitude();
  
      float a, b, c;
  
      a = *x / m;
      b = *y / m;
      c = *z / m;
  
      return new Vector3DHeap(a, b, c);
  }
  </code></pre>
  
  <p>Many thanks,
  George</p>