编译需要开启C++14支持
Code
// fun.h
#include<boost/preprocessor.hpp>
#define SIZE(...) BOOST_PP_TUPLE_SIZE((__VA_ARGS__))
#define _CAT(a, b) a##b
#define CAT(a, b) _CAT(a, b)
#define _STRING(a) #a
#define STRING(a) _STRING(a)
#define OP_HEAD(d, state, x) \
(BOOST_PP_SUB(BOOST_PP_TUPLE_ELEM(2, 0, state), 1), \
BOOST_PP_LIST_CONS(typename CAT(_, BOOST_PP_TUPLE_ELEM(2, 0, state)), BOOST_PP_TUPLE_ELEM(