C++ boost - Is there a container working like a queue with direct key access?

Меня интересовал контейнер, похожий на очередь, но у которого есть доступ по ключу, как карта. My goal is simple : I want a FIFO queue, but, if I insert an element and an element with a given key is already in the queue, I want it the new element to replaced the one already in the queue. For example, a map ordered by insertion time would work .

If there is no container like that, do you think it can be implemented by using both a queue and a map ?

5
задан Dinaiz 6 December 2010 в 23:50
поделиться