On 10/6/10 6:10 AM, alfC wrote:
I have class that is parameterized by several type (Boost::Unit units type).
template
class A{ A(quantity<U1> q1, quantity<U2> q2, ... ){} }; since the number of arguments is arbitrary I though it would be a good idea to use either MPL sequence and Tuples. Or better yet a fusion::vector.
so the class will be parametrized by a fusion::vector or unit types.
template<class FusionOfUnits> //or class MPLofUnits class A{ A(FusionOfQuantities fq){} //or TupleOfUnits };
The questions is: ¿what is the best way to transform a fusion::vector
into a fusion::vector whete the N is (compile-time) arbitrary, i.e. the lenght of the fist fusion::vector is arbitrary
(If you are not familiar with Boost.Units, unitN is just a type and quantity is a template type.)
Have you tried fusion::transform? Or fusion::transform_view? Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net