I am actually trying to see if I can get a minimal library that supports the very few operations I use from boost::fusion.
Here is what I have so far...
This is the shortest implementation I've discovered:
template struct typelist { };
template struct prepend;
template struct joincols;
template struct zip;
template
struct prepend > {
typedef typelist type;
};
template <>
struct joincols,typelist<> > {
typedef typelist<> type;
};
template
struct joincols,typelist<> > {
typedef typename
prepend<
typelist,
typename joincols,typelist<> >::type
>::type type;
};
template
struct joincols,typelist > {
typedef typename
prepend<
typename prepend::type,
typename joincols,typelist >::type
>::type type;
};
template <>
struct zip<> {
typedef typelist<> type;
};
template
struct zip {
typedef typename joincols::type>::type type;
};