#include <boost/preprocessor/control/while.hpp> #include <boost/preprocessor/list/at.hpp> #define LIST (7, (2, (0, (1, BOOST_PP_NIL)))) #define PRED(d, state) BOOST_PP_LIST_AT_D(d, state, 0) #define OP(d, state) BOOST_PP_LIST_REST(state) BOOST_PP_WHILE(PRED, OP, LIST) // expands to (0, (1, BOOST_PP_NIL))
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)