title: Derived class utilizing a parent object
body: <p>I'd like to have a derived class update when an object of type base is updated because they share the same <em>reference</em> to the base. This would be done after the base class is already created.</p>
  
  <pre><code>class Tumor : sc2::Unit {
  public:
      Tumor(const sc2::Unit *unit) : pointer(unit){}
      ~Tumor()
  
      float spread = 10.0f;
      float vision = 11.0f;
      // Other things...
  
      bool operator==(const Tumor&amp; rhs) { return pointer-&gt;tag == rhs.tag; }
      const sc2::Unit *pointer = nullptr;        
  };
  </code></pre>
  
  <p>Rather than accessing
      <code>tumor.pointer-&gt;tag</code>
  I'd like it to be:
      <code>tumor.tag</code> </p>
  
  <p><code>sc2::Unit</code> has a <code>tag</code> variable and when I put </p>
  
  <p><code>std::cout &lt;&lt; "tumor_tag Address: " &lt;&lt; &amp;(this-&gt;pointer-&gt;tag) &lt;&lt; "\tunit_tag Address: " 
             &lt;&lt; &amp;(unit-&gt;tag) &lt;&lt; std::endl;</code> </p>
  
  <p>in the constructor I would have the same memory location being output.</p>
  
  <p>I'm aware I could store a pointer to <code>sc2::Unit</code> in <code>Tumor</code> (as is shown) but I was trying to find a more elegant solution and my Google-foo is weak or it's not possible.</p>