c++ - priority queue clear method -


How do I delete all the elements from the priority queue? This means how can I destroy the priority queue? Advanced Thanks for your answer Is there any way to clear or erase?

Prathamikta_jyu interface a clear (in) capable I ever considered method (for no good reason ) One easy way to clear it is to just specify a new, empty queue:

  priority_field & lt; Int & gt; Q; // use it q = priority_Q & lt; Int & gt; (); // Reset it  

Comments