Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-08-13 15:17:14

Not actually off-list.
From: "Terje Slettebø" <tslettebo_at_[hidden]>

> >From: "David Abrahams" <dave_at_[hidden]>
> >>From: "Terje Slettebø" <tslettebo_at_[hidden]>
> >> It depends on how the sort is implemented, I guess (one isn't present
> >the
> >> library, yet). As you know, C++ MP isn't mutating, so such a sort
> >> return a sorted copy of the half of the sequence. Likely stored in the
> >same
> >> kind of sequence as the original, to preserve the characteristics of
> >> original sequence.
> >No, and I'm pretty sure this is in part why MPL uses sequences instead
> >iterators: the algorithms that produce new sequences generally take an
> >empty version of the new sequence as an input, and "append" their
> >to it.
> >From the docs (,
> way you describe here doesn't appear to be used a lot. copy/copy_if works
> that way. However, other algorithms, like transform, doesn't work that
> In fact, there isn't a lot of algorithms that take an empty sequence, and
> returns new sequence of the same type. Could you give more examples than
> ones above?


> Preferable listed in the docs. :)
> Even though transform doesn't take an empty sequence as a parameter, it
> that it returns a sequence with the same characteristics as the input
> sequence. Which I why I assumed a sort could behave similarly.

OK. I guess I was wrong.


Boost list run by bdawes at, gregod at, cpdaniel at, john at