Generally, I would use boost::mpl::for_each<>() to traverse a boost::mpl::vector, but this requires a functor with a template function declar
Just encountered the same situation and provided different solution to the problem which I would like to share. It's not as that obvious, but it uses an existing algorithm. The idea is to use pointers instead.
typedef boost::mpl::vector container;
struct functor
{
template void operator()(T*)
{
std::cout << "created " << typeid(T).name() << std::endl;
}
};
int main()
{
boost::mpl::for_each(functor());
}
so here we get a null pointers, but we don't care as we are not going to use them.
As I stated before that is not obvious in the code and would probably require some additional comments, but it still solves the question without writing any additional code.
added
I think Diego Sevilla suggested something similar.