
18 Jan
2010
18 Jan
'10
7:25 p.m.
I am trying to write code that is as independent of the struct as possible. The first thing that comes to my mind for the ctor is
struct params { ...// there are 7 members, in the 100 or so different structs I will have, max 20 members maybe template <typename T1, ... typename T7> params(const fusion::vector<T1,...T7>& v); };
This probably isn't what you meant. How to generalize it to any fusion sequence? Is it possible to generalize the number of template args?
What about: template <typename Seq> params(Seq const& seq, typename boost::enable_if< fusion::traits::is_sequence<Seq> >::type* = NULL); ? Regards Hartmut --------------- Meet me at BoostCon www.boostcon.com