Indicates if I want to reverse my priority queues, I should use the following code:
#include & lt; Iostream & gt; #include & lt; Queue & gt; using namespace std; Class mycomparison {reverse baul; Public: mycomparison (const bool & revparam = false) {reverse = reptum;} Bull Operator () (Constant and Lives, Constant and RA) Const {if (Returning) returns (LHS> RA); And return (LHS & lt; rhs); }}; Int main () {int myints [] = {10,60,50,20}; Priority_youm and lieutenant; Int, vector & lt; Int & gt;, mycomparison (true) & gt; First; Return 0; } This disturbs me:
- I have to specify the storage class in my constructor.
- I have created a class whose priority is to pass the only purpose in the queue.
Is there a more elegant or less verbose way of reverse-sorting of the priority queue? You can not specify storage containers, but you can avoid writing your own draft:
Privacy_Jews & lt; Int, vector & lt; Int & gt; std :: big & lt; Int & gt; & Gt; First;
No comments:
Post a Comment