This is the mail archive of the cygwin-apps@cygwin.com 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] Postinstallscript ordering in setup - take 3)


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>.

Attachment: signature.asc
Description: This is a digitally signed message part


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