title: I created deque<CObject*> and added different type of element. How can I change attribute of this elements?
body: <p>I created:</p>
  
  <pre><code>class CMap:{
  public
  std::deque&lt;CObject*&gt; obiekty;
  }
  
  
  class CBullet{
  public:
  int damage;
  }
  </code></pre>
  
  <p>and I added different type of element ( e.g.  CTank, CBullet...)
  and I want change atributes using deque</p>
  
  <pre><code>for( size_t i=0; i&lt;game-&gt;Mapa-&gt;obiekty.size(); i++){
  
   if(typeid(*(game-&gt;Mapa-&gt;obiekty[i]))==typeid(CBullet)){                                       
    this-&gt;HP=this-&gt;HP - game-&gt;Mapa-&gt;obiekty[i] (?? my problem/I can't do it ?? -&gt;damage); 
  
  }
  }
  </code></pre>