How to change comparison function on a priority queue with boost library?
I have a struct like this :
struct decreasingOrderMyType
{
bool operator() (const MyType & lhs, const MyType & rhs) const
{
return lhs.value > rhs.value;
}
};
and i would like use it to compare my elements.
thanks!
For the std::priority_queue I have it specified as:
std::priority_queue<DistanceTuple, std::vector<DistanceTuple>, SmallestOnTop > pq;DistanceTupleis astd::pairandSmallestOnTopis a functor to compare thestd::pairUpdate: I was wrong, they are not identical. The boost version uses named parameters. Which work like this: