#include <boost/preprocessor/punctuation/comma_if.hpp> #include <boost/preprocessor/repetition/repeat.hpp> #define MACRO(z, n, text) BOOST_PP_COMMA_IF(n) text BOOST_PP_REPEAT(3, MACRO, class) // class, class, class に展開される