C++ c++;类型列表累积
我已经开始研究boost::mpl::vector等类型的列表 我希望能够做的一件事是跨多个头聚合类型。例如,我定义了 校长1:C++ c++;类型列表累积,c++,boost,metaprogramming,C++,Boost,Metaprogramming,我已经开始研究boost::mpl::vector等类型的列表 我希望能够做的一件事是跨多个头聚合类型。例如,我定义了 校长1: typedef boost::mpl::vector<> typelist; typedef boost::mpl::vector typelist; 校长2-n: // Fails to compile, cannot redefine typelist typedef boost::mpl::push_back<typelist, my_ty
typedef boost::mpl::vector<> typelist;
typedef boost::mpl::vector typelist;
校长2-n:
// Fails to compile, cannot redefine typelist
typedef boost::mpl::push_back<typelist, my_type_i>::type typelist
//编译失败,无法重新定义类型列表
typedef boost::mpl::push_back::type typelist
似乎我应该能够在编译时做这样的事情,因为它仍然只是类型操作,但我不确定是否有办法。请查看@DieterLücking谢谢,这很有效。我想这个问题应该以重复的形式结束