Pages

02 November, 2023

C++ STL Pririty Queue

Trying to do:


#include
#include \

using namespace std;

int main()

{

vector* V = new std::vector();

V[0].push_back(1);
V[0].push_back(2);
V[1].push_back(3);
V[1].push_back(4);
V[2].push_back(5);

priority_queue pq1;

return 0;

}



Getting following error:


/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/queue:425:22: error: type 'std::priority_queue::container_type' (aka 'std::vector *') cannot be used prior to '::' because it has no members
typedef typename container_type::value_type value_type;

No comments:

Post a Comment

Thanks