title: Trying to understand what is happening here with static_cast?
body: <p>I'm working on an old C++ project, in the source there are two lines:</p>
  
  <pre><code>memcpy( static_cast&lt;PLONADDRESS&gt;(this), pa, sizeof(LONADDRESS) );
  memcpy( static_cast&lt;PLONIOFILTER)(this), pf, sizeof(LONIOFILTER) );
  </code></pre>
  
  <p><code>this</code> is an object of type CLonFilterUnit, it is derived from public classes:</p>
  
  <pre><code>class CLonFilterUnit : public LONADDRESS, public LONIOFILTER
  </code></pre>
  
  <p><code>PLONADDRESS</code> is:</p>
  
  <pre><code>typedef LONADDRESS* PLONADRESS;
  </code></pre>
  
  <p><code>PLONFILTER</code> is:</p>
  
  <pre><code>typedef LONIOFILTER* PLONFILTER;
  </code></pre>
  
  <p><code>pa</code> is of type <code>PLONADDRESS</code> and <code>pf</code> is of type <code>PLONIOFILTER</code>.</p>
  
  <p>What I don't understand is how the same base address is used as the destination in both <code>memcpy</code> instructions?  Is this permitted due to the way <code>static_cast</code> works?</p>