#include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/seq/fold_left.hpp> #include <boost/preprocessor/seq/seq.hpp> #define S1 (a)(b)(c) #define S2 (S1)(S1)(S1) #define OP(s, state, x) state (BOOST_PP_SEQ_FOLD_LEFT_ ## s(OP_2, _, x)) #define OP_2(s, state, x) BOOST_PP_CAT(state, x) BOOST_PP_SEQ_FOLD_LEFT(OP, BOOST_PP_SEQ_NIL, S2) // expands to (_abc)(_abc)(_abc)
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt)