今日の日記はModern C++ Designを読んだ人とかLoki(Modern C++ Designで解説されているライブラリ)を使ったことのある人しか意味がわからないと思うのでご了承ください。 Modern C++ Designでは、型のリスト「TypeList」を可変長に扱うため、TYPELIST_1 〜 TYPELIST_50まで、要素の数に応じたマクロを用いることで対応している。つまり、 #define TYPELIST_1(T1) Typelist<T1, NullType> #define TYPELIST_2(T1, T2) Typelist<T1, TYPELIST_1(T2)> #define TYPELIST_3(T1, T2, T3) Typelist<T1, TYPELIST_2(T2, T3)> // ... #define TYPELIST_50(T1, T