#include <boost/preprocessor/logical/and.hpp> #include <boost/preprocessor/control/expr_iif.hpp> #define INSERT_AND(p, q, text) \ BOOST_PP_EXPR_IIF( \ BOOST_PP_AND(p, q), \ text \ ) \ /**/ INSERT_AND(2, 3, abc) // expands to abc INSERT_AND(0, 7, xyz) // expands to nothing
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)