
Boost Users : 
Subject: Re: [Boostusers] [fusion] creating fusionvectors of references
From: Christopher Schmidt (christopher_at_[hidden])
Date: 20120803 10:26:38
"Oswin Krause" <Oswin.Krause_at_[hidden]> writes:
> I have a fusion vector which looks a bit like
>
> typedef fusion::vector<std::vector<A>,std::vector<B>,std::vector<C> > Tuple;
>
> All vectors have the same size and I want from each of these
> std::vectors one specific element (like the 10th from every vector)
> and create a fusion::vector<A&,B&,C&> from these elements(my real
> problem is a bit more complicated, for example one of the vectors
> might be std::vector<bool>, so the type might be different from an
> actual reference)
[...]
> Any solution to my problem? It should work for fusion::vector, but a
> solution which works for all fusion sequences is awarded with bonus
> points :). If there is no solution for fusion::vector, I would
> appreciate a solution for another container as well (but no bonus in
> this case!)
This problem can easily be solved using Boost.MPL. (Including
<boost/fusion/mpl.hpp> will make all Fusion container types valid MPL
sequences.)
Christopher
Boostusers 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