I am creating a simple game and I use std::priority_queue for giving commands to squads (every squad has a priority_que
Aryabhatta's answer of another question applies to this question.
You use a max-heap.
Say you have an N element heap (implemented as an array) which contains the N smallest elements seen so far.
When an element comes in you check against the max (O(1) time), and reject if it is greater.
Iteration mentioned by several earlier comments is unnecessary.