title: casting pointer to pointer... to pointer?
body: <p>I found this snippet</p>
  
  <pre><code>void* operator new(size_t nbytes)
  {
    if (nbytes == 0)
      nbytes = 1;                    // so all alloc's get a distinct address
    void* ans = malloc(nbytes + 4);  // overallocate by 4 bytes
    *(Pool**)ans = NULL;             // use NULL in the global new
    return (char*)ans + 4;           // don't let users see the Pool*
  }
  </code></pre>
  
  <p>here <a href="https://isocpp.org/wiki/faq/dtors" rel="nofollow">https://isocpp.org/wiki/faq/dtors</a></p>
  
  <p>I spent over an hour now trying t understand what <code>*(Pool**)ans = NULL;</code> does.
  <code>ans</code> is a void pointer, so I would assume it is cast to a <code>Pool</code> pointer and the pool is set to 0. Not he pointer but the pool itself, because of the third <code>*</code> on the left. But Pool has no <code>operator=</code> defined.</p>
  
  <p><code>pointer**</code> in a declaration is apparently a pointer to a pointer... but in this context this makes no sense to me, as <code>ans</code> is a single pointer.</p>