#include <boost/preprocessor/arithmetic/inc.hpp> #include <boost/preprocessor/repetition/enum_shifted.hpp> #include <boost/preprocessor/repetition/repeat.hpp> #define TEXT(z, n, text) text #define MACRO(z, n, data) \ ( \ BOOST_PP_ENUM_SHIFTED_ ## z( \ BOOST_PP_INC(n), \ TEXT, data \ ) \ ) \ /**/ 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)