forked from boostorg/preprocessor
Using BOOST_PP_IDENTITY makes code clearer.
This commit is contained in:
@ -24,7 +24,7 @@
|
|||||||
# include <boost/preprocessor/config/config.hpp>
|
# include <boost/preprocessor/config/config.hpp>
|
||||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() && ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
|
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() && ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
|
||||||
# include <boost/preprocessor/tuple/elem.hpp>
|
# include <boost/preprocessor/tuple/elem.hpp>
|
||||||
# include <boost/preprocessor/facilities/empty.hpp>
|
# include <boost/preprocessor/facilities/identity.hpp>
|
||||||
# else
|
# else
|
||||||
# include <boost/preprocessor/cat.hpp>
|
# include <boost/preprocessor/cat.hpp>
|
||||||
# include <boost/preprocessor/detail/split.hpp>
|
# include <boost/preprocessor/detail/split.hpp>
|
||||||
@ -35,7 +35,7 @@
|
|||||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() && ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
|
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() && ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
|
||||||
# define BOOST_PP_IS_EMPTY(x) BOOST_PP_IS_EMPTY_I(x BOOST_PP_IS_EMPTY_HELPER)
|
# define BOOST_PP_IS_EMPTY(x) BOOST_PP_IS_EMPTY_I(x BOOST_PP_IS_EMPTY_HELPER)
|
||||||
# define BOOST_PP_IS_EMPTY_I(contents) BOOST_PP_TUPLE_ELEM(2, 1, (BOOST_PP_IS_EMPTY_DEF_ ## contents()))
|
# define BOOST_PP_IS_EMPTY_I(contents) BOOST_PP_TUPLE_ELEM(2, 1, (BOOST_PP_IS_EMPTY_DEF_ ## contents()))
|
||||||
# define BOOST_PP_IS_EMPTY_DEF_BOOST_PP_IS_EMPTY_HELPER 1, 1 BOOST_PP_EMPTY
|
# define BOOST_PP_IS_EMPTY_DEF_BOOST_PP_IS_EMPTY_HELPER 1, BOOST_PP_IDENTITY(1)
|
||||||
# define BOOST_PP_IS_EMPTY_HELPER() , 0
|
# define BOOST_PP_IS_EMPTY_HELPER() , 0
|
||||||
# else
|
# else
|
||||||
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
|
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#
|
#
|
||||||
# include <boost/preprocessor/control/iif.hpp>
|
# include <boost/preprocessor/control/iif.hpp>
|
||||||
# include <boost/preprocessor/facilities/empty.hpp>
|
# include <boost/preprocessor/facilities/empty.hpp>
|
||||||
|
# include <boost/preprocessor/facilities/identity.hpp>
|
||||||
# include <boost/preprocessor/facilities/is_1.hpp>
|
# include <boost/preprocessor/facilities/is_1.hpp>
|
||||||
# include <boost/preprocessor/facilities/is_empty.hpp>
|
# include <boost/preprocessor/facilities/is_empty.hpp>
|
||||||
#
|
#
|
||||||
@ -22,7 +23,7 @@
|
|||||||
# define BOOST_PP_IS_EMPTY_OR_1(x) \
|
# define BOOST_PP_IS_EMPTY_OR_1(x) \
|
||||||
BOOST_PP_IIF( \
|
BOOST_PP_IIF( \
|
||||||
BOOST_PP_IS_EMPTY(x BOOST_PP_EMPTY()), \
|
BOOST_PP_IS_EMPTY(x BOOST_PP_EMPTY()), \
|
||||||
1 BOOST_PP_EMPTY, \
|
BOOST_PP_IDENTITY(1), \
|
||||||
BOOST_PP_IS_1 \
|
BOOST_PP_IS_1 \
|
||||||
)(x) \
|
)(x) \
|
||||||
/**/
|
/**/
|
||||||
|
@ -14,17 +14,17 @@
|
|||||||
#
|
#
|
||||||
# include <boost/preprocessor/arithmetic/inc.hpp>
|
# include <boost/preprocessor/arithmetic/inc.hpp>
|
||||||
# include <boost/preprocessor/config/config.hpp>
|
# include <boost/preprocessor/config/config.hpp>
|
||||||
# include <boost/preprocessor/facilities/empty.hpp>
|
# include <boost/preprocessor/facilities/identity.hpp>
|
||||||
# include <boost/preprocessor/seq/detail/split.hpp>
|
# include <boost/preprocessor/seq/detail/split.hpp>
|
||||||
# include <boost/preprocessor/tuple/elem.hpp>
|
# include <boost/preprocessor/tuple/elem.hpp>
|
||||||
#
|
#
|
||||||
# /* BOOST_PP_SEQ_REST_N */
|
# /* BOOST_PP_SEQ_REST_N */
|
||||||
#
|
#
|
||||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
||||||
# define BOOST_PP_SEQ_REST_N(n, seq) BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_SPLIT(BOOST_PP_INC(n), (nil) seq BOOST_PP_EMPTY))()
|
# define BOOST_PP_SEQ_REST_N(n, seq) BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_SPLIT(BOOST_PP_INC(n), BOOST_PP_IDENTITY( (nil) seq )))()
|
||||||
# else
|
# else
|
||||||
# define BOOST_PP_SEQ_REST_N(n, seq) BOOST_PP_SEQ_REST_N_I(n, seq)
|
# define BOOST_PP_SEQ_REST_N(n, seq) BOOST_PP_SEQ_REST_N_I(n, seq)
|
||||||
# define BOOST_PP_SEQ_REST_N_I(n, seq) BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_SPLIT(BOOST_PP_INC(n), (nil) seq BOOST_PP_EMPTY))()
|
# define BOOST_PP_SEQ_REST_N_I(n, seq) BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_SPLIT(BOOST_PP_INC(n), BOOST_PP_IDENTITY( (nil) seq )))()
|
||||||
# endif
|
# endif
|
||||||
#
|
#
|
||||||
# endif
|
# endif
|
||||||
|
Reference in New Issue
Block a user