Boost logo

Boost Users :

Subject: Re: [Boost-users] [range] Zip range adaptor
From: Nathan Crookston (nathan.crookston_at_[hidden])
Date: 2011-01-28 01:53:22


Hi Neil,

On Thu, Jan 27, 2011 at 3:37 PM, Neil Groves <neil_at_[hidden]> wrote:
> I will provide a zipped Range Adaptor that does not introduce a dependency
> on Fusion. I will target Boost 1.47 for this feature. Now that the Range
> Adaptor framework is well proven it makes sense to build upon it by
> broadening the Range Adaptor facilities. The zipped adaptor is one of the
> most frequently requested, and is top of my list.

This is great news! Thanks for letting me know.

>> This does raise a naming question.  MPL uses unpack_args, Fusion uses
>> make_fused.  I thought unpack was nice (I also like unzip), but I'm
>> not dead-set on any particular name.  Any thoughts?

> My thoughts on this at the moment are that I will use the MPL names. I will
> probably use directly MPL.

This sounds reasonable to me -- although explicitly calling a range
adaptor a view seems redundant. Perhaps zip and unpack_args?

I'm attaching my code which supplies the (not renamed) zip and unpack
functions. I've tested it on windows with g++3, g++4 (with and
without -std=c++0x), VC8 and VC10. The maximum number of arguments
that may be supplied to zip are controllable by
BOOST_RANGE_MAX_ZIP_ARGUMENTS (defaults to 5). Perhaps you'll find it
useful -- correctly handing rvalues without rvalue references
available was tricky.

Thanks,
Nate






Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net