The C++ std::priority_queue uses a container for storage https://en.cppreference.com/w/cpp/container/priority_queue
By default it is class Container = std::vector<T>
Is this what you want to get access to ? If so, though luck:
C, the underlying container (protected member object)
It is not exposed. You could derive from priority_queue and expose it, if needed. But you post is thin as to what you are actually trying to do.
Keep in mind that:
- The container doesn't store sorted elements. It is a heap, so only the first element will be correct. It might have little actual use.
This answer discusses accessing the Container: Is there a way to access the underlying container of STL container adaptors?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…