
5 Sep
2010
5 Sep
'10
8:35 p.m.
You're already most of the way there. If you can break it down into three similar steps, you can write a single step as a metafunction:
template
struct step : mpl::insert_range< PrevResult , mpl::end< PrevResult >::type , containers< MyType > {};
Then you can fold that step across your types:
typedef typename mpl::fold< my_types, mpl::vector<>, stepmpl::_,mpl::_ >::type all_containers;
This produces a sequence with a different ordering than the one in your "hence" clause, but it's the same ordering as you'd get in your own all_containers above.
Thanks, this starts to become fun. I also found another way with copy and inserters. Cheers, Karsten