diff --git a/include/boost/preprocessor/seq/detail/binary_transform.hpp b/include/boost/preprocessor/seq/detail/binary_transform.hpp index 70897b0..08b5f9d 100644 --- a/include/boost/preprocessor/seq/detail/binary_transform.hpp +++ b/include/boost/preprocessor/seq/detail/binary_transform.hpp @@ -30,14 +30,13 @@ # endif # if BOOST_PP_VARIADICS # if BOOST_PP_VARIADICS_MSVC -# define BOOST_PP_SEQ_BINARY_TRANSFORM_GET_REM(...) \ - BOOST_PP_VARIADIC_IS_SINGLE_RETURN(BOOST_PP_REM_CAT,BOOST_PP_REM,__VA_ARGS__) \ - /**/ +# define BOOST_PP_SEQ_BINARY_TRANSFORM_REM(data) data +# define BOOST_PP_SEQ_BINARY_TRANSFORM_A(...) (BOOST_PP_SEQ_BINARY_TRANSFORM_REM, __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_B +# define BOOST_PP_SEQ_BINARY_TRANSFORM_B(...) (BOOST_PP_SEQ_BINARY_TRANSFORM_REM, __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_A # else -# define BOOST_PP_SEQ_BINARY_TRANSFORM_GET_REM(...) BOOST_PP_REM +# define BOOST_PP_SEQ_BINARY_TRANSFORM_A(...) (BOOST_PP_REM, __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_B +# define BOOST_PP_SEQ_BINARY_TRANSFORM_B(...) (BOOST_PP_REM, __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_A # endif -# define BOOST_PP_SEQ_BINARY_TRANSFORM_A(...) (BOOST_PP_SEQ_BINARY_TRANSFORM_GET_REM(__VA_ARGS__), __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_B -# define BOOST_PP_SEQ_BINARY_TRANSFORM_B(...) (BOOST_PP_SEQ_BINARY_TRANSFORM_GET_REM(__VA_ARGS__), __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_A # else # define BOOST_PP_SEQ_BINARY_TRANSFORM_A(e) (BOOST_PP_REM, e)() BOOST_PP_SEQ_BINARY_TRANSFORM_B # define BOOST_PP_SEQ_BINARY_TRANSFORM_B(e) (BOOST_PP_REM, e)() BOOST_PP_SEQ_BINARY_TRANSFORM_A diff --git a/include/boost/preprocessor/seq/detail/to_list_msvc.hpp b/include/boost/preprocessor/seq/detail/to_list_msvc.hpp new file mode 100644 index 0000000..2599c00 --- /dev/null +++ b/include/boost/preprocessor/seq/detail/to_list_msvc.hpp @@ -0,0 +1,55 @@ +# /* ************************************************************************** +# * * +# * (C) Copyright Edward Diener 2016. * +# * Distributed under the Boost Software License, Version 1.0. (See * +# * accompanying file LICENSE_1_0.txt or copy at * +# * http://www.boost.org/LICENSE_1_0.txt) * +# * * +# ************************************************************************** */ +# +# /* See http://www.boost.org for most recent version. */ +# +# ifndef BOOST_PREPROCESSOR_SEQ_DETAIL_TO_LIST_MSVC_HPP +# define BOOST_PREPROCESSOR_SEQ_DETAIL_TO_LIST_MSVC_HPP +# +# include +# +# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() +# +# include +# include +# include +# include +# +# define BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_RESULT(state) \ + BOOST_PP_TUPLE_ELEM(2, 0, state) \ +/**/ +# define BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_SIZE(state) \ + BOOST_PP_TUPLE_ELEM(2, 1, state) \ +/**/ +# define BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_PRED(d,state) \ + BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_SIZE(state) \ +/**/ +# define BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_OP(d,state) \ + ( \ + BOOST_PP_CAT(BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_RESULT(state),), \ + BOOST_PP_DEC(BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_SIZE(state)) \ + ) \ +/**/ +# +# /* BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC */ +# +# define BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC(result,seqsize) \ + BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_RESULT \ + ( \ + BOOST_PP_WHILE \ + ( \ + BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_PRED, \ + BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_OP, \ + (result,seqsize) \ + ) \ + ) \ +/**/ +# endif // BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() +# +# endif // BOOST_PREPROCESSOR_SEQ_DETAIL_TO_LIST_MSVC_HPP diff --git a/include/boost/preprocessor/seq/to_list.hpp b/include/boost/preprocessor/seq/to_list.hpp index fa0421b..ed8948d 100644 --- a/include/boost/preprocessor/seq/to_list.hpp +++ b/include/boost/preprocessor/seq/to_list.hpp @@ -19,7 +19,19 @@ # # /* BOOST_PP_SEQ_TO_LIST */ # +# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() +# include +# include +# define BOOST_PP_SEQ_TO_LIST(seq) \ + BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC \ + ( \ + BOOST_PP_SEQ_TO_LIST_I(BOOST_PP_SEQ_BINARY_TRANSFORM(seq)), \ + BOOST_PP_SEQ_SIZE(seq) \ + ) \ +/**/ +# else # define BOOST_PP_SEQ_TO_LIST(seq) BOOST_PP_SEQ_TO_LIST_I(BOOST_PP_SEQ_BINARY_TRANSFORM(seq)) +# endif # define BOOST_PP_SEQ_TO_LIST_I(bseq) BOOST_PP_SEQ_TO_LIST_A bseq BOOST_PP_NIL BOOST_PP_SEQ_TO_LIST_B bseq # define BOOST_PP_SEQ_TO_LIST_A(m, e) m(BOOST_PP_LPAREN() e BOOST_PP_COMMA() BOOST_PP_SEQ_TO_LIST_A_ID) # define BOOST_PP_SEQ_TO_LIST_A_ID() BOOST_PP_SEQ_TO_LIST_A