#include <boost/preprocessor/facilities/check_empty.hpp> # if BOOST_PP_VARIADIC_HAS_OPT() #define DATA #define OBJECT OBJECT2 #define OBJECT2 #define FUNC(x) FUNC2(x) #define FUNC2(x) #define FUNC_GEN(x,y) (1,2,3) BOOST_PP_CHECK_EMPTY(DATA) // expands to 1 BOOST_PP_CHECK_EMPTY(OBJECT) // expands to 1 BOOST_PP_CHECK_EMPTY(FUNC(1)) // expands to 1 BOOST_PP_CHECK_EMPTY(FUNC) // expands to 0 BOOST_PP_CHECK_EMPTY(FUNC_GEN) // expands to 0 #endif
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)