
13 Jan
2009
13 Jan
'09
6:19 p.m.
AMDG Hicham Mouline wrote:
There is an example listed in "C++ template metaprogramming" to generate a class with its members from an mpl sequence:
template <typename T> struct wrap { typedef T value; };
typedef mpl::vector< type1, type2, type3 > member_types; mpl::inherit_linearly< member_types, mpl::inherit< wrap<_2>, _1 > >::type generated;
but then, the generated class did not look like this:
class C { type1 t1; type2 t2; type3 t3; };
Can one do that with BOOST_PP and sequences from preprocessor libs instead?
You can--or you can just use fusion.
boost::fusion::as_vector