I need to store class A objects in some data structure. In addition, I would like them to be automatically sorted according to the key, which in my case is an inline object of another class B.
So I decided to use the STL priority queue.
However, it is possible that two or more objects B have the same key value.
My questions:
STL queue queue allows duplicate keys
If he does what I should consider and what predicate should I use?
I know that I could use a multiset, but its Big O notation performance is worse, so I want to use a priority queue.
c ++ stl
Harry
source share