Boost logo

Boost :

Subject: Re: [boost] Formal Review: Boost.RangeEx
From: Giovanni Piero Deretta (gpderetta_at_[hidden])
Date: 2009-02-27 14:21:37


On Fri, Feb 27, 2009 at 8:07 PM, vicente.botet <vicente.botet_at_[hidden]> wrote:
> From: "Rogier van Dalen" <rogiervd_at_[hidden]>
>>
>> I think something like zip() would be very useful, but for consistency
>> should probably be spelled zipped().
>> zipped(rng1, rng2) | transformed (unpack(binary_fun())
>> seems more general for iterating through two ranges in parallel.
>> zipped() would also alleviate the need for for_each over two ranges.
>
> For consistency, why not
>
>    pack(rng1, rng2) | transformed (unpack(binary_fun())
>
> Vicente
>

'zip' is a commonly used name for mapping a pair of ranges to ranges
of pairs in other languages; I see no reason not to use it. Also,
boost.iterator already has zip_iterator adapters.

Another (arguably) good name might be transpose, but that is probably
best left for ranges of ranges.

BTW, unpack already exists in boost as fusion::fused.

-- 
gpd

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