title: Why does static_cast(*this) to a base class create a temporary copy?
body: <p>I'm reading <em>Effective C++</em> and came across this example:</p>
  
  <pre><code>class Window {                                // base class
  public:
    virtual void onResize() { ... }             // base onResize impl
    ...
  };
  
  class SpecialWindow: public Window {          // derived class
  public:
    virtual void onResize() {                   // derived onResize impl;
      static_cast&lt;Window&gt;(*this).onResize();    // cast *this to Window,
                                                // then call its onResize;
                                                // this doesn't work!
  
      ...                                       // do SpecialWindow-
    }                                           // specific stuff
  
    ...
  
  };
  </code></pre>
  
  <p>The book says:</p>
  
  <blockquote>
    <p>What you might not expect is that it does not invoke that function on the current object! Instead, the cast creates a new, temporary copy of the base class part of *this, then invokes onResize on the copy!</p>
  </blockquote>
  
  <p>Why does static_cast (above code) create a new copy? Why not just just use the base class part of the object?</p>