title: Check for "self-assignment" in copy constructor?
body: <p>Today in university I was recommended by a professor that I'd check for <code>(this != &amp;copy)</code> in the copy constructor, similarly to how you should do it when overloading <code>operator=</code>. However I questioned that because I can't think of any situation where <code>this</code> would ever be equal to the argument when constructing an object.</p>
  
  <p>He admitted that I made a good point. So, my question is, does it make sense to perform this checking, or is it impossible that this would screw up?</p>
  
  <p><i><b>Edit</b>: I guess I was right, but I'll just leave this open for a while. Maybe someone's coming up with some crazy cryptic c++ magic.</i></p>
  
  <p><b>Edit2</b>: <code>Test a(a)</code> compiles on MinGW, but not MSVS10. <code>Test a = a</code> compiles on both, so I assume gcc will behave somewhat similar. Unfortunately, VS does <em>not</em> show a debug message with <em>"Variable a used without being initialized"</em>. It does however properly show this message for <code>int i = i</code>. Could this actually be considered a c++ language flaw?</p>
  
  <pre><code>class Test
  {
     Test(const Test &amp;copy)
     {
        if (this != &amp;copy) // &lt;-- this line: yay or nay?
        {
        }
     }
     Test &amp;operator=(const Test &amp;rhd)
     {
        if (this != &amp;rhd) // &lt;-- in this case, it makes sense
        {
        }
     }
  };
  </code></pre>