Corrected implementation and testing for BOOST_PP_VA_OPT

This commit is contained in:
Edward Diener
2019-10-31 06:07:10 -04:00
parent a9827c8fc8
commit 776037ae56
4 changed files with 115 additions and 9 deletions

View File

@ -16,14 +16,19 @@
# include <boost/preprocessor/control/iif.hpp>
# include <boost/preprocessor/facilities/check_empty.hpp>
# include <boost/preprocessor/tuple/rem.hpp>
# define BOOST_PP_VA_OPT(rdata,rempty,...) \
BOOST_PP_TUPLE_REM() \
BOOST_PP_IIF \
( \
BOOST_PP_CHECK_EMPTY(__VA_ARGS__), \
rempty, \
rdata \
} \
/**?
# define BOOST_PP_VA_OPT_IMPL(atuple) \
BOOST_PP_TUPLE_REM() atuple \
/**/
# define BOOST_PP_VA_OPT(rdata,rempty,...) \
BOOST_PP_VA_OPT_IMPL \
( \
BOOST_PP_IIF \
( \
BOOST_PP_CHECK_EMPTY(__VA_ARGS__), \
rempty, \
rdata \
) \
) \
/**/
# endif /* BOOST_PP_VARIADIC_HAS_OPT() */
# endif /* BOOST_PREPROCESSOR_FACILITIES_VA_OPT_HPP */