I am learning Boost.MPL and I am just starting. So please forgive me if solution is obvios. I look at such sample:
#include <boost/mpl/vector.hpp>
#include <boost/mpl/for_each.hpp>
#include <iostream>
using namespace std;
struct A
{
template <class T>
void operator()(T t)
{
cout << typeid(T).name() << "\t" << t << endl;
}
template <class TypeVector>
void FooAll(void)
{
boost::mpl::for_each<TypeVector>(*this);
}
};
void main(void)
{
A a;
a.FooAll<boost::mpl::vector<int, float, long>>();
}
and cant help but wonder how to get rid of boost::mpl::vector
when calling FooALL (turn it into a.FooAll<int, float, long>();
) and for each argument call some static/global/or class internal function, not *this
that confuses me?