mirror of
https://github.com/boostorg/preprocessor.git
synced 2025-07-01 06:50:59 +02:00
Changed functionality so empty arrays/lists when converted to a seq or a tuple expand to nothing.
This commit is contained in:
@ -15,19 +15,32 @@
|
||||
#
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/array/size.hpp>
|
||||
# include <boost/preprocessor/control/if.hpp>
|
||||
# include <boost/preprocessor/facilities/empty.hpp>
|
||||
# include <boost/preprocessor/tuple/to_seq.hpp>
|
||||
#
|
||||
# /* BOOST_PP_ARRAY_TO_SEQ */
|
||||
#
|
||||
# define BOOST_PP_ARRAY_TO_SEQ(array) \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
BOOST_PP_ARRAY_SIZE(array), \
|
||||
BOOST_PP_ARRAY_TO_SEQ_DO, \
|
||||
BOOST_PP_EMPTY \
|
||||
) \
|
||||
(array) \
|
||||
/**/
|
||||
#
|
||||
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
|
||||
# define BOOST_PP_ARRAY_TO_SEQ(array) BOOST_PP_ARRAY_TO_SEQ_I(BOOST_PP_TUPLE_TO_SEQ, array)
|
||||
# define BOOST_PP_ARRAY_TO_SEQ_DO(array) BOOST_PP_ARRAY_TO_SEQ_I(BOOST_PP_TUPLE_TO_SEQ, array)
|
||||
# define BOOST_PP_ARRAY_TO_SEQ_I(m, args) BOOST_PP_ARRAY_TO_SEQ_II(m, args)
|
||||
# define BOOST_PP_ARRAY_TO_SEQ_II(m, args) BOOST_PP_CAT(m ## args,)
|
||||
# elif BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
|
||||
# define BOOST_PP_ARRAY_TO_SEQ(array) BOOST_PP_ARRAY_TO_SEQ_I(array)
|
||||
# define BOOST_PP_ARRAY_TO_SEQ_DO(array) BOOST_PP_ARRAY_TO_SEQ_I(array)
|
||||
# define BOOST_PP_ARRAY_TO_SEQ_I(array) BOOST_PP_TUPLE_TO_SEQ ## array
|
||||
# else
|
||||
# define BOOST_PP_ARRAY_TO_SEQ(array) BOOST_PP_TUPLE_TO_SEQ array
|
||||
# define BOOST_PP_ARRAY_TO_SEQ_DO(array) BOOST_PP_TUPLE_TO_SEQ array
|
||||
# endif
|
||||
#
|
||||
# endif
|
||||
|
Reference in New Issue
Block a user