title: Why C++ copy constructor must use const object?
body: <p>I understand that when we define a class copy constructor of the class is necessary as <a href="http://en.wikipedia.org/wiki/Rule_of_three_%28C++_programming%29" rel="noreferrer">Rule of three</a> states. I also notice that the argument of the copy constructor is usually <code>const</code> as the following codes illustrate: </p>
  
  <pre><code>class ABC {
  public:
      int a;
      int b;
      ABC(const ABC &amp;other)
      { 
          a = other.a;
          b = other.b;
      }
  }
  </code></pre>
  
  <p>My question is what would happen if the argument of the copy constructor is not const:</p>
  
  <pre><code>class ABC
  {
      public:
      int a;
      int b;
      ABC(ABC &amp;other)
      { 
          a = other.a;
          b = other.b;
      }
  }
  </code></pre>
  
  <p>I understand that in some cases if the argument of the copy constructor is const then the second implementation would fail. Also if the argument of the copy constructor is const then the object to be copied will not change its content during the process. However, I do notice that some people still use the second implementation rather than the first one. Are there any reasons that the second implementation is preferred?    </p>