title: In C++, I want to implement a ring iterator for a deque that contains a personally defined class
body: <p>I have a function of a "Table" class that should add a player to the table.  I decided that if the seat is taken, the function should try and go through all the seats and add the player to the next available seat.  How do I implement this in my <code>addPlayer</code> function?</p>
  
  <pre><code>int Table::addPlayer(Player player, int position)
  {
  deque&lt;Player&gt;::iterator it;
  
  if(playerList[position] != "(empty seat)") {
      //What goes here?
  }
  playerList.put(player,it);
  cout &gt;&gt; "Player " &gt;&gt; player.toString &gt;&gt; " sits at position " &gt;&gt; position &gt;&gt; endl;
  </code></pre>
  
  <p>}</p>