Implementing a priority queue that can be iterated over in C++
问题 I need to implement a priority queue for a project, but the STL's priority_queue is not indicated since we need to iterate over all elements and remove them randomly. We are thinking about using the STL's set for this, wrapping it in a class to make it an ADT. Is there a smarter solution for this? How can we make it so some of set 's public member functions can be used publicly? We're interested in iterators, etc. Apparently deriving the STL is unwise because of the lack of virtual