Can we change the comparator of sets, priority_queue at run time in c++?

Правка en1, от slow_hare, 2021-10-11 16:37:53

I had a solution to a problem which included priority queue.

I wish to know if we can change the comparator of priority queue at run time like if we initially had the declaration as priority_queue<int> pq which will store no.s in non-increasing order, can I use the same priority queue to store no.s in increasing order after pq.clear()

Thanks

Теги comparators, set priority queue

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский slow_hare 2021-10-11 16:41:56 1
en1 Английский slow_hare 2021-10-11 16:37:53 431 Initial revision (published)