You need a queue and no duplication, so you have to index it yourself, so you need to use two containers together. You can consider queue + set/unordered_set. When inserting an object, first check whether the object is in the set. If it is, it will fail. If it is not, it will be added to both containers at the same time. Do the opposite when popping out.
A single container cannot satisfy, but you can achieve it yourself. You need to look at the usage scenarios to decide how to implement drunkenness appropriately,
You need a queue and no duplication, so you have to index it yourself, so you need to use two containers together. You can consider queue + set/unordered_set. When inserting an object, first check whether the object is in the set. If it is, it will fail. If it is not, it will be added to both containers at the same time. Do the opposite when popping out.
use {vector/deque/list} + {set/unordered_set}
A single container cannot satisfy, but you can achieve it yourself. You need to look at the usage scenarios to decide how to implement drunkenness appropriately,
No. Let me know what scene you need.