#include <boost/preprocessor/comparison/greater.hpp> #include <boost/preprocessor/list/filter.hpp> #define LIST (1, (2, (3, (4, (5, BOOST_PP_NIL))))) #define PRED(d, _, num) BOOST_PP_GREATER_D(d, num, 2) BOOST_PP_LIST_FILTER(PRED, nil, LIST) // expands to (3, (4, (5, 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)