Q: Priority Queues C++ I was having a hard time understanding priority_queues and was hoping someone could help me understand them a little better.
I have a priority_queue called readyQueue, but I'm not really understanding how to get the objects being placed in it to be placed in a specific order by a certain value.
I have this struct called Process, which I am filling my queues with pointers of.
#include <string>

#define ARRAY_SIZE 10                //size for History array

using std::string;
using std::pair; using std::make_pair;

struct Process {
    string pName;                   //name of process

    pair<char, int> historyAR[ARRAY_SIZE];    //array of pairs
    pair<char, int> historySub;     //subscript for history array

    unsigned pPriority;             //nonnegative, higher values are more important

    int processID,                  //ID for process
        pArrivalTime,               //indicates when the request for process first arrived
        cpuTimer,                   //counts clock ticks til process reaches end of CPU burst 
        ioTimer,                    //counts clock ticks til process reaches end of I/O burst 
        cpuTotal,                   //accumulates number of ticks the process spends active
        iTotal,                     //accumulates number of ticks the process spends Iactive
        oTotal,                     //accumulates number of ticks the process spends Oactive
        cpuCount,                   //counts the CPU burst for this process
        iCount,                     //counts the input burst for this process
        oCount;                     //counts the output burst for this process


    Process(string _pName, unsigned _pPriority, int _processID, int _pArrivalTime, int inAR[], char charAR[]);

    void increaseCPUTimer();
    void increaseIOTimer();
    void printBurst();

    bool operator<(const Process& rhs) const;   
};

bool Process::operator<(const Process& rhs) const {
    return this->pPriority > rhs.pPriority;
}

And have two queues declared like this in my main,
queue<Process*> entryQueue;                           
priority_queue<Process*> readyQueue;

And I am adding to my priority_queue like this,
while(readyQueue.size() < AT_ONCE && entryQueue.size() > 0) {
    readyQueue.push(entryQueue.front());
    entryQueue.pop();
}

But I don't know how to "sort" them where the Process that is being instered with the higher pPriorityvalue (an unsigned number) gets placed to the front of the priority_queue when inserted.
