Re: [Boost-bugs] [Boost C++ Libraries] #4400: BOOST_PP_SEQ_REPLACE fails in corner cases

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4400: BOOST_PP_SEQ_REPLACE fails in corner cases
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-07-11 06:31:37


#4400: BOOST_PP_SEQ_REPLACE fails in corner cases
-------------------------------------------+--------------------------------
  Reporter: Wolf Lammen <ookami1@…> | Owner: no-maintainer
      Type: Bugs | Status: new
 Milestone: Boost 1.44.0 | Component: preprocessor
   Version: Boost 1.44.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------------------+--------------------------------

Comment (by Wolf Lammen <ookami1@…>):

 wrote a test suite checking my fix. It found a bug in the EDG branch.
 Here's the updated file:


 {{{
 #
 ****************************************************************************
 # *
 *
 # * (C) Copyright Paul Mensonides 2002.
 # * 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_REPLACE_HPP
 # define BOOST_PREPROCESSOR_SEQ_REPLACE_HPP
 #
 # include <boost/preprocessor/arithmetic/inc.hpp>
 # include <boost/preprocessor/config/config.hpp>
 # include <boost/preprocessor/seq/detail/split.hpp>
 # include <boost/preprocessor/seq/first_n.hpp>
 # include <boost/preprocessor/facilities/empty.hpp>
 # include <boost/preprocessor/tuple/elem.hpp>
 #
 # /* BOOST_PP_SEQ_REPLACE */
 #
 # if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
 # 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)
 # 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))()
 # else
 # define BOOST_PP_SEQ_REPLACE(seq, i, elem) BOOST_PP_SEQ_REPLACE_I(seq,
 i, elem)
 # define BOOST_PP_SEQ_REPLACE_I(seq, i, elem) BOOST_PP_SEQ_FIRST_N(i,
 seq) (elem) BOOST_PP_SEQ_REST_NP1(i, seq)
 # define BOOST_PP_SEQ_REST_N_PLUS_1(n, seq)
 BOOST_PP_SEQ_REST_N_PLUS_1_I(n, seq)
 # 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))()
 # endif
 #
 # endif


 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4400#comment:4>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC