Ticket #4421: seq_replace.patch

File seq_replace.patch, 2.4 KB (added by Wolf Lammen <ookami1@…>, 12 years ago)
  • boost/preprocessor/seq/replace.hpp

    diff -dur programs/boost_1_43_0/boost/preprocessor/seq/replace.hpp workspace/booster/boost/preprocessor/seq/replace.hpp
    old new  
    11# /* **************************************************************************
    22#  *                                                                          *
    33#  *     (C) Copyright Paul Mensonides 2002.
     4#  *     (C) Copyright Wolf Lammen 2010.
    45#  *     Distributed under the Boost Software License, Version 1.0. (See
    56#  *     accompanying file LICENSE_1_0.txt or copy at
    67#  *     http://www.boost.org/LICENSE_1_0.txt)
    78#  *                                                                          *
    89#  ************************************************************************** */
     10# /* This file has been rewritten in 2010 to fix ticket #4400 */
    911#
    1012# /* See http://www.boost.org for most recent version. */
    1113#
     
    1416#
    1517# include <boost/preprocessor/arithmetic/inc.hpp>
    1618# include <boost/preprocessor/config/config.hpp>
     19# include <boost/preprocessor/facilities/empty.hpp>
    1720# include <boost/preprocessor/seq/first_n.hpp>
    18 # include <boost/preprocessor/seq/rest_n.hpp>
     21# include <boost/preprocessor/seq/detail/split.hpp>
     22# include <boost/preprocessor/tuple/elem.hpp>
    1923#
    2024# /* BOOST_PP_SEQ_REPLACE */
    2125#
    2226# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
    23 #    define BOOST_PP_SEQ_REPLACE(seq, i, elem) BOOST_PP_SEQ_FIRST_N(i, seq) (elem) BOOST_PP_SEQ_REST_N(BOOST_PP_INC(i), seq)
     27#    define BOOST_PP_SEQ_REPLACE(seq, i, elem) BOOST_PP_SEQ_FIRST_N(i, seq) (elem) BOOST_PP_SEQ_REST_N_PLUS_1(i, seq)
     28#    define BOOST_PP_SEQ_REST_N_PLUS_1(n, seq) BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_SPLIT(BOOST_PP_INC(n), seq BOOST_PP_EMPTY))()
    2429# else
    2530#    define BOOST_PP_SEQ_REPLACE(seq, i, elem) BOOST_PP_SEQ_REPLACE_I(seq, i, elem)
    26 #    define BOOST_PP_SEQ_REPLACE_I(seq, i, elem) BOOST_PP_SEQ_FIRST_N(i, seq) (elem) BOOST_PP_SEQ_REST_N(BOOST_PP_INC(i), seq)
     31#    define BOOST_PP_SEQ_REPLACE_I(seq, i, elem) BOOST_PP_SEQ_FIRST_N(i, seq) (elem) BOOST_PP_SEQ_REST_N_PLUS_1(i, seq)
     32#    define BOOST_PP_SEQ_REST_N_PLUS_1(n, seq) BOOST_PP_SEQ_REST_N_PLUS_1_I(n, seq)
     33#    define BOOST_PP_SEQ_REST_N_PLUS_1_I(n, seq) BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_SPLIT(BOOST_PP_INC(n), seq BOOST_PP_EMPTY))()
    2734# endif
    2835#
     36#
    2937# endif