I am trying to understand how the compartor functions work on standard container templates. I was working with std:prioirty_queue container. The explanation says that the elements in the queue follow strict weak ordering of elements. The max element is stored at the top of the queue by following this weak ordering. For my implementation, I wanted to change this container to store the minimum value instead of maximum value. I looked up online and came up with this piece of code
I did this and the priority queue started storing minimal value at the top. I don't understand how overloading () operator and returning the false condition value would make minimal element to be stored at the top. Is there someone who can explain me what's happening?