title: C++ managing objects
body: <p>I've got a game server. It creates number of instances of <code>Game</code> and adds them (Or a pointer to them? What's better? It has 10 <code>ints</code> and 5 other pointers, 10 member functions) to the vector. After that some events happen inside of the game e. g. game_ends. At this very moment the game should be deleted from the vector... What is the best way to achieve it?</p>
  
  <p>The two ways we've come to are:</p>
  
  <ol>
  <li><p>create an observer pattern. server will be an observer and game will dispatch an event to delete it.</p></li>
  <li><p>set the game to <code>ended</code> state while server constantly scans the vector and deletes that games which are in <code>ended</code> state.</p></li>
  </ol>