Copying types from a mpl vector to a fusion vector

Hello. I'm trying to build a library and I'm doing heavy use of boost mpl
and fusion libraries. I'd like to know a way to fill a
boost::fusion::vector<>
with the types contained in a boost::mpl::vector. Anyone knows how to do
this? The code I have so far:
template

On Dec 1, 2007 9:22 AM, Germán Diago
Hello. I'm trying to build a library and I'm doing heavy use of boost mpl and fusion libraries. I'd like to know a way to fill a boost::fusion::vector<> with the types contained in a boost::mpl::vector. Anyone knows how to do this? The code I have so far:
template
struct Func { //This is the initial sequence typedef typename boost::mpl::vector
sequence; //The sequence without NullTypes typedef typename boost::mpl::filter_view
> >::type validsequence; //The vector I want to fill with validsequence. Note that this is a fusion vector, not a mpl vector typedef boost::fusion::vector<> voidvector;
/***************PROBLEM HERE*******************/ //I want to copy validsequence types into voidvector typedef typename somewaytocopy::type type; };
Hi Germán,
I think the following might work (untested):
#include

Hi Germán,
I think the following might work (untested):
#include
#include // ...
typedef typename boost::fusion::result_of::as_vector<validsequence>::type fusion_valid_sequence;
fusion_valid_sequence fusion_vector;
(You can't fill voidvector with the types, since you already made it a fusion::vector<>)
HTH,
Stjepan _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Thank you very much. It worked well.
participants (2)
-
Germán Diago
-
Stjepan Rajko