我知道boost MPL列表或 vector 具有可以半定义的最大长度,但是在大约30个元素之后,编译器讨厌我。 Loki序列可以有多少个元素,用户可以定义吗?

最佳答案

implementation显示18个隐藏的模板参数,因此这应该是上限

     template
     <
         typename T1  = NullType, typename T2  = NullType, typename T3  = NullType,
         typename T4  = NullType, typename T5  = NullType, typename T6  = NullType,
         typename T7  = NullType, typename T8  = NullType, typename T9  = NullType,
         typename T10 = NullType, typename T11 = NullType, typename T12 = NullType,
         typename T13 = NullType, typename T14 = NullType, typename T15 = NullType,
         typename T16 = NullType, typename T17 = NullType, typename T18 = NullType
     >
     struct MakeTypelist { /* stuff */ };

关于c++ - Loki序列可以包含几个元素?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14454198/

10-12 13:57