title: Is comparing two void pointers to different objects defined in C++?
body: <p>Inspired by <a href="https://stackoverflow.com/q/8124133/321013">this answer</a> about dynamic cast to <code>void*</code>:</p>
  
  <blockquote>
  <pre><code>...
  bool eqdc(B* b1, B *b2) {
      return dynamic_cast&lt;void*&gt;(b1) == dynamic_cast&lt;void*&gt;(b2);
  }
  ...
  int main() {
      DD *dd = new DD();
      D1 *d1 = dynamic_cast&lt;D1*&gt;(dd);
      D2 *d2 = dynamic_cast&lt;D2*&gt;(dd);
      ... eqdc(d1, d2) ...
  </code></pre>
  </blockquote>
  
  <p>I am wondering if it is fully defined behaviour in C++ (according to the 03 or 11 standard) to <strong>compare two void pointers for (in)equality</strong> that point to <em>valid</em>, but <strong>different objects</strong>.</p>
  
  <p>More generally, but possibly not as relevant, is comparing (<code>==</code>or <code>!=</code>) two values of type <code>void*</code> always defined, or is it required that they hold a pointer to a valid object/memory area?</p>