Boost logo

Boost :

Subject: Re: [boost] [zip_iterator] Understanding why.
From: Brandon Kohn (blkohn_at_[hidden])
Date: 2008-10-27 10:45:48

From: "Robert Jones" <robertgbjones_at_[hidden]>
Sent: Monday, October 27, 2008 9:24 AM
To: "Boost Developers" <boost_at_[hidden]>
Subject: [boost] [zip_iterator] Understanding why.

> Zip iterator implements the functionality I need to advance associated
> iterators through different ranges, but it seems strangly awkward to
> use, which is odd for Boost. so I'm wondering if I've misunderstood
> the design paradigms.

I'm not the author, but I think the design is reasonable in the context of
the time it was written (which predates the Boost.Range library).

> Given two ranges (say vectors), I'd like to be able to generate an
> iterable composite, anditerate through that, something like
> vector<int> v1;
> vector<int> v2;
> typedef zip_composite<int, int> Z;
> Z zip( v1, v2 );
> for ( Z::iterator i=zip.begin( ); i !=zip.end( ); ++i )
> {
> // ... blah, blah, blah
> }
> Is this impossible or undesirable to implement for reasons I've not
> realized?

Fusion has this exact paradigm in the zip_view.. for compile-time iterators
so it's certainly possible. Perhaps you could submit something based on
Boost.Range as an extension? :D

> Thanks, Rob.
> _______________________________________________
> Unsubscribe & other changes:



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