#include <boost/preprocessor/control/if.hpp> #include <boost/preprocessor/facilities/empty.hpp> #define X() result #define MACRO(c) BOOST_PP_IF(c, X, BOOST_PP_EMPTY)() MACRO(0) // expands to nothing MACRO(1) // expands to result
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)