Re: [Boost-bugs] [Boost C++ Libraries] #4421: fix for #4400

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4421: fix for #4400
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-08-30 14:56:28


#4421: fix for #4400
-------------------------------------------+--------------------------------
  Reporter: Wolf Lammen <ookami1@…> | Owner: no-maintainer
      Type: Patches | Status: new
 Milestone: Boost 1.44.0 | Component: preprocessor
   Version: Boost 1.44.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------------------+--------------------------------

Comment (by ookami1@…):

 Replying to [comment:4 steven_watanabe]:
> Unfortunately, your patch adds an extraneous BOOST_PP_EMPTY in
 BOOST_PP_SEQ_SPLIT. Are you sure that this doesn't break anything else?


 Hi Steven,

 Grepping shows, that the only clients of BOOST_PP_SEQ_SPLIT within boost
 are BOOST_PP_SEQ_FIRST_N and BOOST_PP_SEQ_REST_N, and outside of boost
 SHOULD not exist a user, because BOOST_PP_SEQ_SPLIT, hidden in a detail
 directory, is not part of the preprocessor interface. And both clients, of
 course, have been adapted to the semantic change of BOOST_PP_SEQ_SPLIT.

 The usage of BOOST_PP_EMPTY is an idiom required, because C90 does not
 guarantee proper handling of empty arguments to macros. So MACRO(seq
 BOOST_PP_EMPTY) is a conformant way to pass an empty sequence (or anything
 that might expand to nothing) as a non-empty argument to a macro. During
 expansion the padded BOOST_PP_EMPTY is easily popped off by appending ()
 to the passed argument. This technique is found all over the preprocessor
 code.

 BOOST_PP_SEQ_SPLIT has been tailored to follow this idiom suit: It expects
 a sequence padded with BOOST_PP_EMPTY, and it will return both the head
 and the tail of a split sequence padded again. This safe handling of empty
 heads or tails allowed the fixing BOOST_PP_SEQ_REPLACE (and, to boot,
 BOOST_PP_REST_N, BOOST_PP_FIRST_N)

 cheers Wolf Lammen

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4421#comment:5>
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:04 UTC