In C++, I want to implement a ring iterator for a deque that contains a personally defined class.
- by George
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 addPlayer function?
int Table::addPlayer(Player player, int position)
{
deque<Player>::iterator it;
if(playerList[position] != "(empty seat)") {
//What goes here?
}
playerList.put(player,it);
cout >> "Player " >> player.toString >> " sits at position " >> position >> endl;
}