I'm creating a
No, there is no way of doing that. The reason being is that if you had access to the underlying container, you could access it and modify it like it wasn't a priority queue, which would be very confusing and against the wanted use case of
std::priority_queue, which is to provide a queue.
This is from the Standards point of view, maybe your implementation has an extension that allows that access, but that would be very surprising, and I know no implementation that does this. You should consult the appropriate documentation to be sure.
Having said that, you can always provide a wrapper around
std::priority_queue, which stores the container. But I would not recommend it, (as said above) you would be able to change it without the queue semantics.