I want to construct three different priority_queue‘s that hold a class Thing and then sort each one differently by values that are held by the Thing. I know that I can define an operator method either internally, or a friend to the object, but is there a way to have it use different test method(s)? How do I tell it to use that method instead of the operator method? And how would the parameter list differ from creating an operator overload?
I want to construct three different priority_queue ‘s that hold a class Thing and
Share
Like most STL containers, the
priority_queueaccepts a Compare class in its template arguments.