title: Conversion of pointer-to-pointer between derived and base classes?
body: <p>Regarding the following C++ program:</p>
  
  <pre><code>class Base { };
  
  class Child : public Base { };
  
  int main()
  {   
      // Normal: using child as base is allowed
      Child *c = new Child();
      Base *b = c;
  
      // Double pointers: apparently can't use Child** as Base**
      Child **cc = &amp;c;
      Base **bb = cc;
  
      return 0;
  }
  </code></pre>
  
  <p>GCC produces the following error on the last assignment statement:</p>
  
  <pre><code>error: invalid conversion from ‘Child**’ to ‘Base**’
  </code></pre>
  
  <p>My question is in two parts:</p>
  
  <ol>
  <li>Why is there no implicit conversion from Child** to Base**?</li>
  <li>I can make this example work with a C-style cast or a <code>reinterpret_cast</code>.  Using these casts means throwing away all type safety.  Is there anything I can add to the class definitions to make these pointers cast implicitly, or at least phrase the conversion in a way that allows me to use <code>static_cast</code> instead? </li>
  </ol>