Why does std::priority_queue return largest elements first (i.e. is a maximal priority queue) even though it uses std::less as the compare type?
This particularly confuses me when I want to create a minimal queue, which would be done by std::priority_queue<T, std::vector<T>, std::greater<T>>.
The priority queue is acting opposite to sort(), making things less consistent. If you sort() a vector using the greater comparator, then front() of the vector is your largest value. If you create a priority queue using greater then front is the smallest value. I realize a priority queue uses a heap, but I feel like there is a good reason for this.