I have a queue. If it exceeds X size, when I push an element I want to remove the first element of the queue. (the last element that would get popped and the first element pushed in)
void ClientPlayerManager::queueTableMessage( const std::string& playerName, const std::string& message )
{
m_tableQ.push(std::make_pair(playerName,message));
if(m_tableQ.size() > m_maxTableMessages)
{
//m_tableQ.pop_back(); does not exist
}
}
Is there a way to do this with a std queue?
Thanks