Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2003-04-11 22:54:12


Aleksey Gurtovoy wrote:
> Paul Mensonides wrote:
>>> #include "boost/preprocessor/repeat.hpp"
>>> #include "boost/preprocessor/seq/elem.hpp"
>>>
>>> #define b( x, y ) x y
>>> #define BODY( unused, n, tuple ) tuple
>>>
>>> #define SOMETHING( arity, params ) \
>>> BOOST_PP_REPEAT( \
>>> arity \
>>> , BODY \
>>> , ( a, BOOST_PP_SEQ_ELEM(0, params), c ) \
>>> ) \
>>> /**/
>>>
>>> SOMETHING( 5, (b)(d) )
>>
>> Do the parts work independently?
>>
>> BOOST_PP_SEQ_ELEM(0, (b)(c)) -> b
>>
>> BOOST_PP_REPEAT(5, BODY, (a, b, c)) -> (a, b, c) (a, b, c) // etc.
>
> Yep, they do - that's why I named it "BOOST_PP_REPEAT +
> BOOST_PP_SEQ_ELEM bug".

That is what I figured, but I wanted to make sure that the (a, b, c) wasn't
causing a problem--which it shouldn't be anyway. I'll look at this later when I
have time to install VC6 on my other computer. VC has a really annoying problem
with expansion order, and that is likely causing this problem.

Paul Mensonides


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk