Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Preprocessor] Why BOOST_PP_SEQ_CAT with a sequence of comma separated pair is a missuse ?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2014-03-11 13:30:40


AMDG

On 03/11/2014 02:46 AM, Albert wrote:
> I tried to use the BOOST_PP_SEQ_CAT with a sequence of parenthesized
> comma-separated pair of token. It works fine with visual 2010 but fails
> with gcc. I first think that there were a problem in the specific gcc
> implementation part. That's why I opened the issue 9633 :
> https://svn.boost.org/trac/boost/ticket/9633
> But, it has recently been closed for invalidity, the corrector telling
> that it is not a valid use.
>
> <snip>
> So my questions are :
> => why the code I proposed is invalid ?

You are correct that this is a valid sequence. The
problem is that the elements cannot be concatenated.
BOOST_PP_CAT(('a', 1), ('b', 2)) should also fail
with a similar error.

> => Is the workaround proposed with BOOST_PP_SEQ_FOR_EACH is also a
> missused and may fail according to evolutions of the library ?
>

Your workaround does not use ## and is therefore perfectly fine.

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net