Der Andere wrote:[color=blue]
>[color=green]
> > I need to implement a sorted (ordered) list. STL has no sorted list type[/color]
> as[color=green]
> > far as I know. Is there a (straight) way to implement a sorted list using
> > STL?
> > BTW: The type of items in the list will be a class. Is it necessary to
> > implement the > or < operators or to write a compare-function that returns
> > the larger or smaller of two classes? Ideally, the list begins with the
> > smallest element.[/color]
>
> Sorry, I was wrong there: The items in the list will be *pointers* to
> instances of a class. If I use multiset::insert() then the items will be
> ordered according to their (address) value, not according to the value of
> the objects they point to. This is exactly what I do _not_ want ...[/color]
Not if you provide the multiset with a predicate which tells it in which
way you want the ordering to be done.
--
Karl Heinz Buchegger
kbuchegg@gascad.at