For example, I have a tuple
tuple<int, float, char> t(0, 1.1, 'c');
and a template function
template<class T> void foo(T e);
and I want to loop the tuple element with the function, how to implement it, like using boost::mpl::for_each to implement the following?
template<class Tuple>
void loopFoo(Tuple t)
{
foo<std::tuple_element<0, Tuple>::type>(std::get<0>(t));
foo<std::tuple_element<1, Tuple>::type>(std::get<1>(t));
foo<std::tuple_element<2, Tuple>::type>(std::get<2>(t));
...
}