From 542bd2653d5f395fbcfea4e6f19a2d2d51dd10c9 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Tue, 24 Jun 2014 15:01:39 -0400 Subject: [PATCH] Use expand to fix VC++ problem. --- include/boost/preprocessor/tuple/elem.hpp | 3 ++- include/boost/preprocessor/tuple/rem.hpp | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/boost/preprocessor/tuple/elem.hpp b/include/boost/preprocessor/tuple/elem.hpp index 99d0d45..0ee8a3f 100644 --- a/include/boost/preprocessor/tuple/elem.hpp +++ b/include/boost/preprocessor/tuple/elem.hpp @@ -17,6 +17,7 @@ # # include # include +# include # include # include # include @@ -26,7 +27,7 @@ # if BOOST_PP_VARIADICS_MSVC # define BOOST_PP_TUPLE_ELEM(...) BOOST_PP_TUPLE_ELEM_I(BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_ELEM_O_, __VA_ARGS__), (__VA_ARGS__)) # define BOOST_PP_TUPLE_ELEM_I(m, args) BOOST_PP_TUPLE_ELEM_II(m, args) -# define BOOST_PP_TUPLE_ELEM_II(m, args) BOOST_PP_CAT(m ## args,) +# define BOOST_PP_TUPLE_ELEM_II(m, args) BOOST_PP_CAT(BOOST_PP_EXPAND(m ## args),) /* Use BOOST_PP_REM_CAT if it is a single element tuple ( which might be empty ) else use BOOST_PP_REM. This fixes a VC++ problem with an empty tuple and BOOST_PP_TUPLE_ELEM diff --git a/include/boost/preprocessor/tuple/rem.hpp b/include/boost/preprocessor/tuple/rem.hpp index 808cab9..fe8a7d2 100644 --- a/include/boost/preprocessor/tuple/rem.hpp +++ b/include/boost/preprocessor/tuple/rem.hpp @@ -15,7 +15,9 @@ # # include # include +# include # include +# include # # /* BOOST_PP_REM */ # @@ -121,11 +123,12 @@ # if BOOST_PP_VARIADICS_MSVC # define BOOST_PP_TUPLE_REM_CTOR(...) BOOST_PP_TUPLE_REM_CTOR_I(BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_REM_CTOR_O_, __VA_ARGS__), (__VA_ARGS__)) # define BOOST_PP_TUPLE_REM_CTOR_I(m, args) BOOST_PP_TUPLE_REM_CTOR_II(m, args) -# define BOOST_PP_TUPLE_REM_CTOR_II(m, args) BOOST_PP_CAT(m ## args,) +# define BOOST_PP_TUPLE_REM_CTOR_II(m, args) BOOST_PP_CAT(BOOST_PP_EXPAND(m ## args),) +# define BOOST_PP_TUPLE_REM_CTOR_O_1(tuple) BOOST_PP_TUPLE_IS_SINGLE_RETURN(BOOST_PP_REM_CAT,BOOST_PP_REM,tuple) tuple # else # define BOOST_PP_TUPLE_REM_CTOR(...) BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_REM_CTOR_O_, __VA_ARGS__)(__VA_ARGS__) +# define BOOST_PP_TUPLE_REM_CTOR_O_1(tuple) BOOST_PP_REM tuple # endif -# define BOOST_PP_TUPLE_REM_CTOR_O_1(tuple) BOOST_PP_REM tuple # define BOOST_PP_TUPLE_REM_CTOR_O_2(size, tuple) BOOST_PP_TUPLE_REM_CTOR_O_1(tuple) # else # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()