title: c++ polymorphism and list
body: <pre><code>struct struct_unit{};
  struct struct_unit_rotable : struct_unit {};
  
  std::list &lt;struct_unit&gt; unitsList;
  
  
  
  struct_unit *su=new struct_unit_rotable;
  unitsList.push_front(*su);
  </code></pre>
  
  <p>then i have 2 draw methods:</p>
  
  <pre><code>void drawUnit(struct_unit &amp;su);
  void drawUnit(struct_unit_rotable &amp;su);
  </code></pre>
  
  <p>when i call <code>drawUnit(unitsList.front());</code> --- the WRONG nonrotable draw method is called</p>
  
  <p>how to correctly insert 
  <code>struct_unit_rotable</code> type into <code>list</code> so the <code>unitsList.front()</code> will return type <code>struct_unit_rotable</code>?</p>