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

Robert Collins rbcollins@cygwin.com
Sun Mar 16 20:18:00 GMT 2003


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.

because it's not a strict weak ordering, if we have:

foo: bar, zonk
gam: bar
zonk: bar
bar:

and we insert: bar zonk gam foo

we will compare:

zonk > bar (true)
   zonk
bar

gam > zonk (false)
gam > bar (true)
  gam 
bar zonk

foo > gam (false)
foo > bar (true)
    gam
  foo  zonk
bar

which then has foo before zonk, even though foo > zonk is true!

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

-- 
GPG key available at: <http://users.bigpond.net.au/robertc/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20030316/32579ec7/attachment.sig>


More information about the Cygwin-apps mailing list