Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/125.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ c++;类型列表累积_C++_Boost_Metaprogramming - Fatal编程技术网

C++ c++;类型列表累积

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

我已经开始研究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_type_i>::type typelist
//编译失败,无法重新定义类型列表
typedef boost::mpl::push_back::type typelist

似乎我应该能够在编译时做这样的事情,因为它仍然只是类型操作,但我不确定是否有办法。

请查看@DieterLücking谢谢,这很有效。我想这个问题应该以重复的形式结束