From 4cce94a84ec47903570754e2324fa46415d23d2a Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Fri, 27 Sep 2019 09:44:15 -0400 Subject: [PATCH] Segregate C20 macros code from other macros for BOOST_PP_IS_EMPTY --- .../facilities/is_empty_variadic.hpp | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/include/boost/preprocessor/facilities/is_empty_variadic.hpp b/include/boost/preprocessor/facilities/is_empty_variadic.hpp index f194a3f..4beb3c9 100644 --- a/include/boost/preprocessor/facilities/is_empty_variadic.hpp +++ b/include/boost/preprocessor/facilities/is_empty_variadic.hpp @@ -37,6 +37,7 @@ /**/ #define BOOST_PP_IS_EMPTY_ZERO(param) 0 # else +# if defined(__cplusplus) && __cplusplus > 201703L # include #define BOOST_PP_IS_EMPTY(...) \ BOOST_PP_DETAIL_IS_EMPTY_IIF \ @@ -49,6 +50,20 @@ ) \ (__VA_ARGS__) \ /**/ +#define BOOST_PP_IS_EMPTY_FUNCTION2(...) \ + __VA_OPT__(0,) 1 \ +/**/ +#define BOOST_PP_IS_EMPTY_FUNCTION(...) \ + BOOST_PP_IS_EMPTY_FUNCTION2(__VA_ARGS__) \ +/**/ +#define BOOST_PP_IS_EMPTY_OPT(...) \ + BOOST_PP_VARIADIC_OPT_ELEM0(BOOST_PP_IS_EMPTY_FUNCTION(__VA_ARGS__),) \ +/**/ +# else +#define BOOST_PP_IS_EMPTY(...) \ + BOOST_PP_IS_EMPTY_NO_OPT(__VA_ARGS__) \ +/**/ +# endif /* defined(__cplusplus) && __cplusplus > 201703L */ #define BOOST_PP_IS_EMPTY_NO_OPT(...) \ BOOST_PP_DETAIL_IS_EMPTY_IIF \ ( \ @@ -64,17 +79,6 @@ (__VA_ARGS__) \ /**/ #define BOOST_PP_IS_EMPTY_ZERO(...) 0 -# if defined(__cplusplus) && __cplusplus > 201703L -#define BOOST_PP_IS_EMPTY_FUNCTION2(...) \ - __VA_OPT__(0,) 1 \ -/**/ -#endif -#define BOOST_PP_IS_EMPTY_FUNCTION(...) \ - BOOST_PP_IS_EMPTY_FUNCTION2(__VA_ARGS__) \ -/**/ -#define BOOST_PP_IS_EMPTY_OPT(...) \ - BOOST_PP_VARIADIC_OPT_ELEM0(BOOST_PP_IS_EMPTY_FUNCTION(__VA_ARGS__),) \ -/**/ # endif /* BOOST_PP_VARIADICS_MSVC && _MSC_VER <= 1400 */ # endif /* BOOST_PP_VARIADICS */ # endif /* BOOST_PREPROCESSOR_FACILITIES_IS_EMPTY_VARIADIC_HPP */