From 8ac31eb612844ab4b66c15f5b2ae8552a95433c7 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Fri, 23 May 2014 10:23:40 -0400 Subject: [PATCH] Changed BOOST_PP_EMPTY to only use the variadic version when not VC++. Corrected others to use local version of EMPTY. --- include/boost/preprocessor/array/to_seq.hpp | 4 ++-- include/boost/preprocessor/array/to_tuple.hpp | 4 ++-- include/boost/preprocessor/facilities/empty.hpp | 6 +++++- .../boost/preprocessor/facilities/is_empty_variadic.hpp | 7 ++++--- include/boost/preprocessor/list/to_tuple.hpp | 7 ++++--- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/include/boost/preprocessor/array/to_seq.hpp b/include/boost/preprocessor/array/to_seq.hpp index 3534d9c..7303f34 100644 --- a/include/boost/preprocessor/array/to_seq.hpp +++ b/include/boost/preprocessor/array/to_seq.hpp @@ -17,7 +17,6 @@ # include # include # include -# include # include # # /* BOOST_PP_ARRAY_TO_SEQ */ @@ -27,10 +26,11 @@ ( \ BOOST_PP_ARRAY_SIZE(array), \ BOOST_PP_ARRAY_TO_SEQ_DO, \ - BOOST_PP_EMPTY \ + BOOST_PP_ARRAY_TO_SEQ_EMPTY \ ) \ (array) \ /**/ +# define BOOST_PP_ARRAY_TO_SEQ_EMPTY(array) # # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() # define BOOST_PP_ARRAY_TO_SEQ_DO(array) BOOST_PP_ARRAY_TO_SEQ_I(BOOST_PP_TUPLE_TO_SEQ, array) diff --git a/include/boost/preprocessor/array/to_tuple.hpp b/include/boost/preprocessor/array/to_tuple.hpp index b513e22..0d8defa 100644 --- a/include/boost/preprocessor/array/to_tuple.hpp +++ b/include/boost/preprocessor/array/to_tuple.hpp @@ -16,7 +16,6 @@ # include # include # include -# include # # /* BOOST_PP_ARRAY_TO_TUPLE */ # @@ -25,9 +24,10 @@ ( \ BOOST_PP_ARRAY_SIZE(array), \ BOOST_PP_ARRAY_DATA, \ - BOOST_PP_EMPTY \ + BOOST_PP_ARRAY_TO_TUPLE_EMPTY \ ) \ (array) \ /**/ +# define BOOST_PP_ARRAY_TO_TUPLE_EMPTY(array) # # endif diff --git a/include/boost/preprocessor/facilities/empty.hpp b/include/boost/preprocessor/facilities/empty.hpp index 99e1daa..0829a13 100644 --- a/include/boost/preprocessor/facilities/empty.hpp +++ b/include/boost/preprocessor/facilities/empty.hpp @@ -19,10 +19,14 @@ # # /* BOOST_PP_EMPTY */ # -# if BOOST_PP_VARIADICS +# if BOOST_PP_VARIADICS && !BOOST_PP_VARIADICS_MSVC # define BOOST_PP_EMPTY(...) # else # define BOOST_PP_EMPTY() # endif # +# if BOOST_PP_VARIADICS +# define BOOST_PP_VARIADIC_EMPTY(...) +# endif +# # endif diff --git a/include/boost/preprocessor/facilities/is_empty_variadic.hpp b/include/boost/preprocessor/facilities/is_empty_variadic.hpp index c2700fe..eee4062 100644 --- a/include/boost/preprocessor/facilities/is_empty_variadic.hpp +++ b/include/boost/preprocessor/facilities/is_empty_variadic.hpp @@ -16,7 +16,6 @@ # # if BOOST_PP_VARIADICS # -# include # include # include # @@ -31,11 +30,12 @@ ) \ ) \ ( \ - 0 BOOST_PP_EMPTY, \ + BOOST_PP_IS_EMPTY_ZERO, \ BOOST_PP_DETAIL_IS_EMPTY_PROCESS \ ) \ (param) \ /**/ +#define BOOST_PP_IS_EMPTY_ZERO(param) 0 # else #define BOOST_PP_IS_EMPTY(...) \ BOOST_PP_DETAIL_IS_EMPTY_IIF \ @@ -46,11 +46,12 @@ ) \ ) \ ( \ - 0 BOOST_PP_EMPTY, \ + BOOST_PP_IS_EMPTY_ZERO, \ BOOST_PP_DETAIL_IS_EMPTY_PROCESS \ ) \ (__VA_ARGS__) \ /**/ +#define BOOST_PP_IS_EMPTY_ZERO(...) 0 # endif /* BOOST_PP_VARIADICS_MSVC && _MSC_VER <= 1400 */ # endif /* BOOST_PP_VARIADICS */ # endif /* BOOST_PREPROCESSOR_FACILITIES_IS_EMPTY_VARIADIC_HPP */ diff --git a/include/boost/preprocessor/list/to_tuple.hpp b/include/boost/preprocessor/list/to_tuple.hpp index d693b91..c7b3da8 100644 --- a/include/boost/preprocessor/list/to_tuple.hpp +++ b/include/boost/preprocessor/list/to_tuple.hpp @@ -17,7 +17,6 @@ # include # include # include -# include # # /* BOOST_PP_LIST_TO_TUPLE */ # @@ -25,11 +24,12 @@ BOOST_PP_IIF \ ( \ BOOST_PP_LIST_IS_NIL(list), \ - BOOST_PP_EMPTY, \ + BOOST_PP_LIST_TO_TUPLE_EMPTY, \ BOOST_PP_LIST_TO_TUPLE_DO \ ) \ (list) \ /**/ +# define BOOST_PP_LIST_TO_TUPLE_EMPTY(list) # # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG() # define BOOST_PP_LIST_TO_TUPLE_DO(list) (BOOST_PP_LIST_ENUM(list)) @@ -44,11 +44,12 @@ BOOST_PP_IIF \ ( \ BOOST_PP_LIST_IS_NIL(list), \ - BOOST_PP_EMPTY, \ + BOOST_PP_LIST_TO_TUPLE_R_EMPTY, \ BOOST_PP_LIST_TO_TUPLE_R_DO \ ) \ (r, list) \ /**/ +# define BOOST_PP_LIST_TO_TUPLE_R_EMPTY(r,list) # # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG() # define BOOST_PP_LIST_TO_TUPLE_R_DO(r, list) (BOOST_PP_LIST_ENUM_R(r, list))