From b70598c3578e1c58d29e9e84005fc746e291929e Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Mon, 26 May 2014 16:36:30 -0400 Subject: [PATCH] Using BOOST_PP_IDENTITY makes code clearer. --- include/boost/preprocessor/facilities/is_empty.hpp | 4 ++-- include/boost/preprocessor/facilities/is_empty_or_1.hpp | 3 ++- include/boost/preprocessor/seq/rest_n.hpp | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/boost/preprocessor/facilities/is_empty.hpp b/include/boost/preprocessor/facilities/is_empty.hpp index e7f821f..d0403a9 100644 --- a/include/boost/preprocessor/facilities/is_empty.hpp +++ b/include/boost/preprocessor/facilities/is_empty.hpp @@ -24,7 +24,7 @@ # include # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() && ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC() # include -# include +# include # else # include # include @@ -35,7 +35,7 @@ # 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_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 # else # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() diff --git a/include/boost/preprocessor/facilities/is_empty_or_1.hpp b/include/boost/preprocessor/facilities/is_empty_or_1.hpp index baa5da9..815666f 100644 --- a/include/boost/preprocessor/facilities/is_empty_or_1.hpp +++ b/include/boost/preprocessor/facilities/is_empty_or_1.hpp @@ -14,6 +14,7 @@ # # include # include +# include # include # include # @@ -22,7 +23,7 @@ # define BOOST_PP_IS_EMPTY_OR_1(x) \ BOOST_PP_IIF( \ BOOST_PP_IS_EMPTY(x BOOST_PP_EMPTY()), \ - 1 BOOST_PP_EMPTY, \ + BOOST_PP_IDENTITY(1), \ BOOST_PP_IS_1 \ )(x) \ /**/ diff --git a/include/boost/preprocessor/seq/rest_n.hpp b/include/boost/preprocessor/seq/rest_n.hpp index 7e589cc..6423376 100644 --- a/include/boost/preprocessor/seq/rest_n.hpp +++ b/include/boost/preprocessor/seq/rest_n.hpp @@ -14,17 +14,17 @@ # # include # include -# include +# include # include # include # # /* BOOST_PP_SEQ_REST_N */ # # 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 # 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