#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) // expands to class, class, class
根据 Boost 软件许可证第 1.0 版分发。(参见随附文件 LICENSE_1_0.txt 或在 www.boost.org/LICENSE_1_0.txt 复制)