Segregate C20 macros code from other macros for BOOST_PP_IS_EMPTY

This commit is contained in:
Edward Diener
2019-09-27 09:44:15 -04:00
parent 2f9be1086a
commit 4cce94a84e

View File

@ -37,6 +37,7 @@
/**/ /**/
#define BOOST_PP_IS_EMPTY_ZERO(param) 0 #define BOOST_PP_IS_EMPTY_ZERO(param) 0
# else # else
# if defined(__cplusplus) && __cplusplus > 201703L
# include <boost/preprocessor/variadic/opt.hpp> # include <boost/preprocessor/variadic/opt.hpp>
#define BOOST_PP_IS_EMPTY(...) \ #define BOOST_PP_IS_EMPTY(...) \
BOOST_PP_DETAIL_IS_EMPTY_IIF \ BOOST_PP_DETAIL_IS_EMPTY_IIF \
@ -49,6 +50,20 @@
) \ ) \
(__VA_ARGS__) \ (__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(...) \ #define BOOST_PP_IS_EMPTY_NO_OPT(...) \
BOOST_PP_DETAIL_IS_EMPTY_IIF \ BOOST_PP_DETAIL_IS_EMPTY_IIF \
( \ ( \
@ -64,17 +79,6 @@
(__VA_ARGS__) \ (__VA_ARGS__) \
/**/ /**/
#define BOOST_PP_IS_EMPTY_ZERO(...) 0 #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_MSVC && _MSC_VER <= 1400 */
# endif /* BOOST_PP_VARIADICS */ # endif /* BOOST_PP_VARIADICS */
# endif /* BOOST_PREPROCESSOR_FACILITIES_IS_EMPTY_VARIADIC_HPP */ # endif /* BOOST_PREPROCESSOR_FACILITIES_IS_EMPTY_VARIADIC_HPP */