1 # /* ************************************************************************** 2 # * * 3 # * (C) Copyright Edward Diener 2019. 4 # * Distributed under the Boost Software License, Version 1.0. (See 5 # * accompanying file LICENSE_1_0.txt or copy at 6 # * http://www.boost.org/LICENSE_1_0.txt) 7 # * * 8 # ************************************************************************** */ 9 # 10 # /* See http://www.boost.org for most recent version. */ 11 # 12 # include <libs/preprocessor/test/test.h> 13 # include <boost/preprocessor/facilities/check_empty.hpp> 14 15 # if BOOST_PP_VARIADIC_HAS_OPT() 16 17 # include <boost/preprocessor/facilities/empty.hpp> 18 19 #define DATA 20 #define OBJECT OBJECT2 21 #define OBJECT2 22 #define FUNC(x) FUNC2(x) 23 #define FUNC2(x) 24 #define FUNC_GEN() () 25 #define FUNC_GEN2(x) () 26 #define FUNC_GEN3() (&) 27 #define FUNC_GEN4(x) (y) 28 #define FUNC_GEN5() (y,z) 29 #define FUNC_GEN6() anything 30 #define FUNC_GEN7(x) anything 31 #define FUNC_GEN8(x,y) (1,2,3) 32 #define FUNC_GEN9(x,y,z) anything 33 #define FUNC_GEN10(x) (y) data 34 #define NAME &name 35 #define ATUPLE (atuple) 36 #define ATUPLE_PLUS (atuple) data 37 38 BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN) == 0 END 39 BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN2) == 0 END 40 BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN3) == 0 END 41 BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN4) == 0 END 42 BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN5) == 0 END 43 BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN8) == 0 END 44 BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN9) == 0 END 45 BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN10) == 0 END 46 BEGIN BOOST_PP_CHECK_EMPTY(BOOST_PP_EMPTY()) == 1 END 47 BEGIN BOOST_PP_CHECK_EMPTY(DATA BOOST_PP_EMPTY()) == 1 END 48 BEGIN BOOST_PP_CHECK_EMPTY(x BOOST_PP_EMPTY()) == 0 END 49 BEGIN BOOST_PP_CHECK_EMPTY(OBJECT BOOST_PP_EMPTY()) == 1 END 50 BEGIN BOOST_PP_CHECK_EMPTY(FUNC(z) BOOST_PP_EMPTY()) == 1 END 51 BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN6) == 0 END 52 BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN7) == 0 END 53 BEGIN BOOST_PP_CHECK_EMPTY(NAME) == 0 END 54 BEGIN BOOST_PP_CHECK_EMPTY(ATUPLE) == 0 END 55 BEGIN BOOST_PP_CHECK_EMPTY(ATUPLE_PLUS) == 0 END 56 57 # else 58 59 BEGIN 1 == 1 END 60 61 # endif 62