forked from boostorg/preprocessor
Simplify get_data.
This commit is contained in:
@ -14,37 +14,20 @@
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/tuple/rem.hpp>
|
||||
#
|
||||
# if BOOST_PP_VARIADICS && BOOST_PP_VARIADICS_MSVC && _MSC_VER > 1400
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/control/if.hpp>
|
||||
# include <boost/preprocessor/control/iif.hpp>
|
||||
# include <boost/preprocessor/facilities/is_1.hpp>
|
||||
#
|
||||
# /* BOOST_PP_ARRAY_DETAIL_GET_DATA */
|
||||
#
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_SINGLE(size, data) BOOST_PP_TUPLE_REM_CAT(size) data
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_NONE(size, data)
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY(size, data) BOOST_PP_TUPLE_REM(size) data
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_CHECK_ZERO(size, data) \
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA(size, data) \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
size, \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY, \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_SINGLE \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_NONE \
|
||||
) \
|
||||
(size,data) \
|
||||
/**/
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA(size, data) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_IS_1(size), \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_SINGLE, \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_CHECK_ZERO \
|
||||
) \
|
||||
(size,data) \
|
||||
/**/
|
||||
# else
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA(size, data) BOOST_PP_TUPLE_REM(size) data
|
||||
# endif /* BOOST_PP_VARIADICS && BOOST_PP_VARIADICS_MSVC && _MSC_VER > 1400 */
|
||||
#
|
||||
# endif /* BOOST_PREPROCESSOR_ARRAY_DETAIL_GET_DATA_HPP */
|
||||
|
@ -21,7 +21,7 @@
|
||||
#
|
||||
# if BOOST_PP_VARIADICS
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
/* To be used internally when __VA_ARGS__ is a single element */
|
||||
/* To be used internally when __VA_ARGS__ could be empty ( or is a single element ) */
|
||||
# define BOOST_PP_REM_CAT(...) BOOST_PP_CAT(__VA_ARGS__,)
|
||||
# endif
|
||||
# define BOOST_PP_REM(...) __VA_ARGS__
|
||||
@ -36,7 +36,7 @@
|
||||
*/
|
||||
# if BOOST_PP_VARIADICS && !(BOOST_PP_VARIADICS_MSVC && _MSC_VER <= 1400)
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
/* To be used internally when the size is 1 */
|
||||
/* To be used internally when the size could be 0 ( or 1 ) */
|
||||
# define BOOST_PP_TUPLE_REM_CAT(size) BOOST_PP_REM_CAT
|
||||
# endif
|
||||
# define BOOST_PP_TUPLE_REM(size) BOOST_PP_REM
|
||||
|
Reference in New Issue
Block a user