Re: sorting problem
Comp1597@yahoo.co.uk wrote:
On Apr 2, 1:10 am, Comp1...@yahoo.co.uk wrote:
Suppose we have pairs of integers of the form (a,b). I want to define
(a,b) <= (c,d) as meaning a >=c and b<=d
(The motivation for this definition is that it means that the interval
(a,b) is a subset of (c,d) ).
Are there any STL functions that can be used for this type of sort? I
don't believe the standard sort (applied to the standard containers)
would work.
Thank you.
I should have said explicitly that I want to sort according to this
new definition of <=. Of course, there will be incomparable
elements. My aim is to transform the original set of pairs into
several sets of pairs where each set is totally ordered.
Standard sort applies predicate but the predicate should have the strict
weak ordering trait. I am not sure that the "less-or-equal" qualifies.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask