title: Prevent derived class from casting to base
body: <p>I have </p>
  
  <pre><code>class Rect{
     // stuff
  };
  </code></pre>
  
  <p>and</p>
  
  <pre><code>class SpecialRect:public Rect{
  private:
       operator const Rect(){return *this;}          // No implicits casts to Rect
  public:
       // stuff
  };
  </code></pre>
  
  <p>SpecialRect inherits all the properties and methods from Rect except that I want to avoid non-explicit conversions of SpecialRect to the base class Rect.</p>
  
  <p>In the code</p>
  
  <pre><code>SpecialRect oneSpecial;
  Rect aRect=oneSpecial;          // I want this to not compile. (to remind-me to declare aRect as SpecialTect)
  </code></pre>
  
  <p>Compiles with no errors. 
  (I know that declaring the base class Rect as private would do it but I don't want to reimplement all its methods.)</p>
  
  <p>Is there a way to achieve this?</p>