title: C++ object equality
body: <p>I have a class <code>MyCloth</code> and one one object instance of that class that I instantiated like this:</p>
  
  <pre><code>MyCloth** cloth1;
  </code></pre>
  
  <p>And at one point in the program, I will do something like this:</p>
  
  <pre><code>MyCloth** cloth2 = cloth1;
  </code></pre>
  
  <p>And then at some point later, I want to check to see if <code>cloth1</code> and <code>cloth2</code> are the same. (Something like object equality in Java, only here, <code>MyCloth</code> is a very complex class and I can''t build an <code>isEqual</code> function.)</p>
  
  <p>How can I do this equality check? I was thinking maybe checking if they point to the same addresses. Is that a good idea? If so, how do I do that?</p>