Boost logo

Boost Users :

Subject: [Boost-users] fusion/adapted/mpl.hpp
From: e r (erwann.rogard_at_[hidden])
Date: 2008-09-10 13:01:03


Hi,

I would need this:

// a)
typedef fusion::vector<...> input0_type;

typedef mpl::transform(
 input0_type,
 F0
)::type result0_type;

//b)

typedef fusion::vector<...> resul1_type;

result1_type result1 = fusion::transform(
 result0_type(),
 f1
);

Of course a) is not allowed, but I guess I can do:

// a)
typedef mpl::vector<...> mpl_input0_type; //same elements as input0_type

typedef mpl::transform(
 mpl_input0_type,
 F0
)::type mpl_result0_type;

//b)
#include <boost/fusion/adapted/mpl.hpp>
#include <boost/fusion/include/mpl.hpp>

typedef fusion::vector<...> resul1_type;

result1_type result1 = fusion::transform(
 mpl_result0_type(),//?
 f1
);

in my case, result1_type = input0_type. So I have to define input0_type
and mpl_input0_type separately although they convey the same
information. i'd like to get rid of this redundancy.

I wished there existed a metafun fusion_to_mpl such that

MPL_ASSERT((is_same<fusion_to_mpl<input0_type>::type,mpl_input0_type>))

so that the 1st version of a) could be replaced by

typedef mpl::transform(
 fusion_to_mpl<input0_type>::type,
 F0
)::type mpl_result0_type;

and keep the second version of b)

any help appreciated.

thanks!


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