
Hi,
(I keep struggling with Boos.Fusion.)
How do I deduce the type of the vector resulting from the
transformation of another vector?
I have a source vector of different types, e.g.
vector
and I have a transformation that is well defined and returns another
type depending on the original type.
The question is how do I generate a vector type that is the result of
the given transformation. I though that
result_of::transform was the function to obtain the result but it
turns not because it returns a type transform_view instead of a
vector.
vector< ... > v1;
T? v2(transform(v1, transformation()));
i.e. what is the type of T as a fusion::vector as deduced from the
type of v1 and the transformation type? -- Thank you, Alfredo--
Below is the illustrative code:
#includesi::time >::type
type;
};
template<typename Q>
typename result
::type, divide_typeof_helper
si::mass, quantitysi::time ::type, divide_typeof_helper si::time, quantitysi::time >::type > result_type ;
result_type v2( boost::fusion::transform(v1, divide() ) ); clog << "v2: " << at_c<0>(v2) << ", "<< at_c<1>(v2) << ", " << at_c<2>(v2) << endl; return 0; }