In C++20 variadic data can be empty. This means that BOOST_PP_VARIADIC_SIZE now returns 0 for empty data instead of 1, and that conversions to and from empty variadic data and lists or arrays, which can be empty, work properly.

This commit is contained in:
Edward Diener
2020-06-29 21:57:23 -04:00
parent ffb26db146
commit 3ac4c915a3
14 changed files with 173 additions and 16 deletions
+10
View File
@@ -29,6 +29,7 @@
# include <boost/preprocessor/list/size.hpp>
# include <boost/preprocessor/variadic/elem.hpp>
# include <boost/preprocessor/variadic/size.hpp>
# include <boost/preprocessor/variadic/has_opt.hpp>
# include <libs/preprocessor/test/test.h>
# define SEQ_NONE ()
@@ -215,7 +216,16 @@ BEGIN BOOST_PP_LIST_SIZE(BOOST_PP_SEQ_TO_LIST(SEQ_NONE)) == 1 END
#if BOOST_PP_VARIADICS
# if BOOST_PP_VARIADIC_HAS_OPT()
BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_SEQ_ENUM(SEQ_NONE)) == 0 END
# else
BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_SEQ_ENUM(SEQ_NONE)) == 1 END
# endif
BEGIN BOOST_PP_VARIADIC_ELEM(0,BOOST_PP_SEQ_ENUM(SEQ)) == 4 END
BEGIN BOOST_PP_TUPLE_ELEM(2,BOOST_PP_SEQ_ELEM(0,BOOST_PP_VARIADIC_SEQ_TO_SEQ(SEQVAR))) == 8 END