[fusion] incremental zipping

Hi,
I am zipping fusion sequences in a series of incremental zip operations:
zip(zip(zip(a,b),c),...)
as a result I am getting sequence with elements like:
vector2

Gennadiy Rozental
Hi,
I am zipping fusion sequences in a series of incremental zip operations:
zip(zip(zip(a,b),c),...)
as a result I am getting sequence with elements like:
vector2
,c[i]>,...> what I want instead is that elements would look like:
What the simplest way to achieve this?
--8<---------------cut here---------------start------------->8---
#include

Christopher Schmidt
auto v=push_back( push_back( push_back( make_vector(),boost::ref(a)),boost::ref(b)),boost::ref(c)); auto z=zip_view
(v);
This is not what I want. Let @ denote zipping operation. I want: x = a @ b // x == ((0,1),(1,2)) ... y = x @ c // y = ((0,1,2),(1,2,3)) Right now I am getting y = (((0,1),2),((1,2),3)) Gennadiy P.S. You example does not work for me push_back.hpp does not build under MSVC10

On 11/20/2011 6:44 AM, Gennadiy Rozental wrote:
Christopher Schmidt
writes: auto v=push_back( push_back( push_back( make_vector(),boost::ref(a)),boost::ref(b)),boost::ref(c)); auto z=zip_view
(v); This is not what I want. Let @ denote zipping operation. I want:
x = a @ b // x == ((0,1),(1,2)) ... y = x @ c // y = ((0,1,2),(1,2,3))
Right now I am getting y = (((0,1),2),((1,2),3))
Gennadiy
P.S. You example does not work for me push_back.hpp does not build under MSVC10
Builds fine with me using both VC2010 and g++. Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com

Joel de Guzman
Builds fine with me using both VC2010 and g++.
After I just include this:
#include

On 11/20/2011 10:15 AM, Gennadiy Rozental wrote:
Joel de Guzman
writes: Builds fine with me using both VC2010 and g++.
After I just include this: #include
I am getting this from express edition:
You might want to update from SVN. There's been some recent bug fixes in trunk and release.
What about original question BTW? Do you have a suggestion?
I'll look into it later tonight. I need to understand better what you want. Right now, I'm in Sunday mode ;-) Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com

Gennadiy Rozental
Christopher Schmidt
writes: auto v=push_back( push_back( push_back( make_vector(),boost::ref(a)),boost::ref(b)),boost::ref(c)); auto z=zip_view
(v); This is not what I want. Let @ denote zipping operation. I want:
x = a @ b // x == ((0,1),(1,2)) ... y = x @ c // y = ((0,1,2),(1,2,3))
Right now I am getting y = (((0,1),2),((1,2),3))
Gennadiy
P.S. You example does not work for me push_back.hpp does not build under MSVC10
That's a tough questions. You cannot unzip a zip_view, add another sequence, and zip it again. I'd either use transform to flatten the nested zip_view's, or I'd store the sequences separately and rebuild the zip_view every time on the fly. Christopher

Gennadiy Rozental wrote:
Hi,
I am zipping fusion sequences in a series of incremental zip operations:
zip(zip(zip(a,b),c),...)
as a result I am getting sequence with elements like:
vector2
,c[i]>,...> what I want instead is that elements would look like:
What the simplest way to achieve this?
Gennadiy
I think what you want is "deduce_sequence" - it's in the docs Robert Ramey
participants (4)
-
Christopher Schmidt
-
Gennadiy Rozental
-
Joel de Guzman
-
Robert Ramey