2011-12-05 42 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