Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-07-25 11:51:33

On Wed, 25 Jul 2001, Vladimir Prus wrote:
> On Wednesday 25 July 2001 19:39, darylew_at_[hidden] wrote:
> > It is the start of an algorithm collection. It currently has a
> > double-bounded mismatch and swap. There's no docs right
> > now.

Yes, there is certainly a need for double-bounded mismatch.

We've discussed starting an algorithms library before, but at the time
there wasn't enough motivation. I agree with Vladimir, we should
definitely start up this effort again.

One issue is how we should coordinate this. I imagine this library may end
up being a bunch of contributions from a number of people.

One possibility would be that we could start a CVS branch for the
algorithms library. We could then build up the collection of algorithms
for a while, and then once it stabalizes we could go through the review.

Another option is to just submit the algorithms for review one (or more)
at a time and slowly build up the library that way.

Beman, what do you think is the right way to do this?

> 1. Would it make sense to make versions of all the algorithms working on
> containers, not iterators pair. Possible ways:
> - use 'iseq' function:
> sort(iseq(b, e))
> (Suggestion from TC++PL)
> - use similar names
> sort_c(v);
> - use the same names.
> sort(v).
> Having no language support for concepts, some functions will ambiguate
> existing and explicit qualification will be needed. However, I use this
> approach for about year and don't find many inconveniences.

Going with a variant of "sort_c" would probably be safest, perhaps
"sort_range" would be a better name (no abbreviations please!).

I'm thinking the container algorithms should use the begin(c), end(c)
syntax for maximum flexibility, and that we should have a concept named
something like "Range" to describe these things.

> 2. There's a lot of functions that I have found usefull. Are they of interest
> to others? (Template head omitted in prototypes, some type are given for
> illustraction only and should be replaced with more complex expressions)

Great list! I've been using a number of those functions for a while now
(with the same names in fact) and love the convenience.


 Jeremy Siek www:
 Ph.D. Candidate, IU B'ton email: jsiek_at_[hidden]
 Summer Manager, AT&T Research phone: (973) 360-8185

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