title: Array contents equality in C++
body: <p>Is there a way to get the equality operators to work for comparing arrays of the same type?</p>
  
  <p>For example:</p>
  
  <pre><code>int x[4] = {1,2,3,4};
  int y[4] = {1,2,3,4};
  int z[4] = {1,2,3,5};
  if (x == y) cout &lt;&lt; "It worked!"
  </code></pre>
  
  <p>I'm aware that as is, it's just comparing pointer values - but I was hoping there's some kind of typedef trick or something like that so it wouldn't need a loop or a memcmp call.</p>