2011-12-05 38 views

回答

3

做一个仿函数,并呼吁提高:: for_each的:

struct print_class_name { 
    template <typename T> 
    void operator()(T t) const { 
     std::cout << typeid(t).name() << " "; 
    } 
}; 

boost::mpl::for_each<Sequence>(print_class_name()); 
+0

... .. UPS我的意思是打印到的#define在orderto把它作为一个预处理visiable字符串。 – user1078642