c++boost-mpltypelistc++-loki

How many elements can a Loki sequence have?


I know boost MPL list or vectors have maximum lengths which are semi definable but after about 30 elements the compiler hates me. How many elements can a Loki sequence have and is it user definable?


Solution

  • The implementation shows 18 hidden template parameters, so this should be the upper limit

         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 */ };