This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Partial vs. strict weak ordering (was Re: [PATCH] Postinstall script ordering in setup - take 3)


On 17 Mar 2003, Robert Collins wrote:

> On Mon, 2003-03-17 at 06:51, Igor Pechtchanski wrote:
> > STL containers won't choke, as they only need a partial order, AFAIU.
> > The "fail" simply means it's not a strict weak ordering.
> They can and will do the wrong thing.

You're right, of course.  My statement above was too general.  Let me try

STL containers that require LessThanComparable (i.e., partial ordering)
will not choke.  Sorted Associative Containers that require
StrictWeakOrdering *will* fail (because the relation I defined isn't).

I thought that only LessThanComparable is needed for the "sort()" function
of the list container.  Upon rereading
<>, however, I realized that the
sort() function does require a strict weak ordering (but doesn't refer to
StrictWeakOrdering, but rather to LessThanComparable).
I'm a bit confused now.

> because it's not a strict weak ordering, if we have:
> [snip]
> This is because your ordering requires direct comparison to all members
> I don't have time right now to go into the maths above, will do so
> later.
> Rob

I believe I agreed before that the operator I defined is not a strict weak
ordering.  Now it seems that that's what's needed, even for the list's
sort().  I'll need to think on that one some more.
P.S. FYI, sort() called with my operator< seems to do the right thing,
surprisingly, producing a topologically-ordered list...  Go figure...
      |\      _,,,---,,_		pechtcha at cs dot nyu dot edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor at watson dot ibm dot com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]