Boost logo

Boost :

Subject: Re: [boost] Formal Review: Boost.RangeEx - missing algorithms
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2009-02-22 06:54:49

Neil Groves skrev:
> Dear Vicente,
e beginning.
> The _n operations are replaced if the input is a model of the
> RandomAccessRangeConcept with boost::copy( output, input | sliced(0, n) )
> for example, but on reflection this can and must be improved before release.
> If I simply add a first_n adaptor then we can replace all _n algorithms with
> a superior adaptor for all valid ranges. Hence I propose to add something
> that would allow:
> boost::copy( output, input | first_n(n) );
> I am pleased that you made me justify dropping the _n versions, because
> frankly my solution is currently insufficient to be a perfect substition.

We should investigate all possiblites to partition the sequence
[x1,...,xm] here. We might have

  | first_n(n) ~ sliced(0,n) ~ [x1,...,xn]
  | sliced(y,z) ~ [y,y+1...,z-1,z]
  | last_n(n) ~ sliced(m-n,n) ~ [x(m-n),...,xm]

maybe this suggest a more intuitive name for sliced(), but I don't know.


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