title: How to create copy constructor in C++/CX with class having properties
body: <p>I'm new to C++/CX. I want to create a Vector class with two properties X and Y.</p>
  
  <p>In standard C++, the copy constructor is:</p>
  
  <pre><code>Vector(const Vector&amp; v);
  </code></pre>
  
  <p>I translate that to C++/CX as:</p>
  
  <pre><code>Vector(const Vector^ v);
  </code></pre>
  
  <p>Here's the class:</p>
  
  <p>Header:</p>
  
  <pre><code>ref class Vector
  {
  public:
      Vector();
      Vector(const Vector^ v);
  
      property double X;
      property double Y;
  };
  </code></pre>
  
  <p>Implementation:</p>
  
  <pre><code>Vector::Vector()
  {
      X = 0;
      Y = 0;
  }
  
  Vector::Vector(const Vector^ v)
  {
      this-&gt;X = v-&gt;X;
      this-&gt;Y = v-&gt;Y;
  }
  </code></pre>
  
  <p>But I got an error when assigning v->X to this->X as: no instance of function "Vector::X::get" matches the argument list and object (the object as type qualifiers that prevent a match).</p>
  
  <p>How to implement the copy constructor correctly?</p>
  
  <p>Thanks.</p>