Ticket #4421: seq_first_rest_n.patch

File seq_first_rest_n.patch, 3.7 KB (added by ookami1@…, 12 years ago)
  • boost/preprocessor/seq/detail/split.hpp

    diff -dur /home/wolf/programs/boost_1_44_0/boost/preprocessor/seq/detail/split.hpp /home/wolf/programs/boost_1_44_0_patched/boost/preprocessor/seq/detail/split.hpp
    old new  
    2222#    define BOOST_PP_SEQ_SPLIT_D(n, seq) (BOOST_PP_SEQ_SPLIT_ ## n seq)
    2323# else
    2424#    define BOOST_PP_SEQ_SPLIT_D(n, seq) (BOOST_PP_SEQ_SPLIT_ ## n ## seq)
     25#    define BOOST_PP_SEQ_SPLIT_0_BOOST_PP_EMPTY BOOST_PP_EMPTY, BOOST_PP_EMPTY
    2526# endif
    2627#
    27 # define BOOST_PP_SEQ_SPLIT_1(x) (x),
     28# define BOOST_PP_SEQ_SPLIT_0 BOOST_PP_EMPTY,
     29# define BOOST_PP_SEQ_SPLIT_1(x) (x) BOOST_PP_EMPTY,
    2830# define BOOST_PP_SEQ_SPLIT_2(x) (x) BOOST_PP_SEQ_SPLIT_1
    2931# define BOOST_PP_SEQ_SPLIT_3(x) (x) BOOST_PP_SEQ_SPLIT_2
    3032# define BOOST_PP_SEQ_SPLIT_4(x) (x) BOOST_PP_SEQ_SPLIT_3
  • boost/preprocessor/seq/first_n.hpp

    diff -dur /home/wolf/programs/boost_1_44_0/boost/preprocessor/seq/first_n.hpp /home/wolf/programs/boost_1_44_0_patched/boost/preprocessor/seq/first_n.hpp
    old new  
    1313# define BOOST_PREPROCESSOR_SEQ_FIRST_N_HPP
    1414#
    1515# include <boost/preprocessor/config/config.hpp>
    16 # include <boost/preprocessor/control/if.hpp>
     16# include <boost/preprocessor/facilities/empty.hpp>
    1717# include <boost/preprocessor/seq/detail/split.hpp>
    18 # include <boost/preprocessor/tuple/eat.hpp>
    1918# include <boost/preprocessor/tuple/elem.hpp>
    2019#
    2120# /* BOOST_PP_SEQ_FIRST_N */
    2221#
    2322# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
    24 #    define BOOST_PP_SEQ_FIRST_N(n, seq) BOOST_PP_IF(n, BOOST_PP_TUPLE_ELEM, BOOST_PP_TUPLE_EAT_3)(2, 0, BOOST_PP_SEQ_SPLIT(n, seq (nil)))
     23#    define BOOST_PP_SEQ_FIRST_N(n, seq) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_SEQ_SPLIT(n, seq BOOST_PP_EMPTY))()
    2524# else
    2625#    define BOOST_PP_SEQ_FIRST_N(n, seq) BOOST_PP_SEQ_FIRST_N_I(n, seq)
    27 #    define BOOST_PP_SEQ_FIRST_N_I(n, seq) BOOST_PP_IF(n, BOOST_PP_TUPLE_ELEM, BOOST_PP_TUPLE_EAT_3)(2, 0, BOOST_PP_SEQ_SPLIT(n, seq (nil)))
     26#    define BOOST_PP_SEQ_FIRST_N_I(n, seq) BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_SEQ_SPLIT(n, seq BOOST_PP_EMPTY))()
    2827# endif
    2928#
    3029# endif
  • boost/preprocessor/seq/rest_n.hpp

    diff -dur /home/wolf/programs/boost_1_44_0/boost/preprocessor/seq/rest_n.hpp /home/wolf/programs/boost_1_44_0_patched/boost/preprocessor/seq/rest_n.hpp
    old new  
    1212# ifndef BOOST_PREPROCESSOR_SEQ_REST_N_HPP
    1313# define BOOST_PREPROCESSOR_SEQ_REST_N_HPP
    1414#
    15 # include <boost/preprocessor/arithmetic/inc.hpp>
    1615# include <boost/preprocessor/config/config.hpp>
    1716# include <boost/preprocessor/facilities/empty.hpp>
    1817# include <boost/preprocessor/seq/detail/split.hpp>
     
    2120# /* BOOST_PP_SEQ_REST_N */
    2221#
    2322# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
    24 #    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))()
     23#    define BOOST_PP_SEQ_REST_N(n, seq) BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_SPLIT(n, seq BOOST_PP_EMPTY))()
    2524# else
    2625#    define BOOST_PP_SEQ_REST_N(n, seq) BOOST_PP_SEQ_REST_N_I(n, seq)
    27 #    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))()
     26#    define BOOST_PP_SEQ_REST_N_I(n, seq) BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_SPLIT(n, seq BOOST_PP_EMPTY))()
    2827# endif
    2928#
    3029# endif