Boost logo

Boost :

From: shunsuke (pstade.mb_at_[hidden])
Date: 2007-11-19 20:37:08

Giovanni Piero Deretta wrote:
> Finally, I didn't implement the two parameter transform. I use the
> single parameter
> one composed with zip (which, unlike boost::zip_iterator, stops at the
> end of the smaller sequence).
> I only provide algorithms that take two sequences if I have to iterate
> on the sequences at different speed,
> like in std::merge or in a relational join.

BTW, std::merge too will be obsolete by range adaptor `merged`.

> BTW, I've been wondering if algorithms that return a single iterator,
> should return instead a range:
> for example upper_bound should return [first, found), lower_bound
> should return [found, end) and equal_range
> the intersection of the two i.e. [lower_found, upper_found).

For some reason, user might want [found, end) from upper_bound.
Fortunately every algorithm of Oven is a FunctionObject
which can be used with Boost.Lambda,
so that you can write `rng|applied(bind(upper_bound, _1, v), end)`.
Lambda support seems essential feature for functional programming.


Shunsuke Sogame

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