Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2001-07-25 12:26:40


----- Original Message -----
From: Vladimir Prus <ghost_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, July 25, 2001 1:11 PM
Subject: Boost algorithm library (Was: [boost] New upload: algorithm.zip 1)

> On Wednesday 25 July 2001 19:39, darylew_at_[hidden] wrote:
>
> [SNIP]
>
> 1. Would it make sense to make versions of all the algorithms working on
> containers, not iterators pair.
>
Why do you need this functionality?
Consider that an algorithm taking a range can always be called with
(c.begin(),c.end()); whereas an algorithm taking a container cannot be
called with a range (not without a range_view). From the algorithm point of
view, the range based interface is more flexible.

There is the case, though, of algorithms that need to perform operations
that are not supported by the iterators, such as erase.
Is this what you need?
In that case you have to consider that different containers have different
semantics, and a consistent trait-based categorization of containers is not
currently available.You will need that in order to make sure that the
container feed to the algorithms meets the 'container category'
requirements, and to adapt the algorithm implementation to the container
used.

Most of the examples you shown doesn't require containers -can be
implemented in terms of iterators-.

Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk