Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2003-04-11 21:57:53


Aleksey Gurtovoy wrote:
> Preprocessing of the test case below using MSVC 6.5 produces
>
> 0 0 0 0 0
>
> instead of expected
>
> ( a, b, c ) ( a, b, c ) ( a, b, c ) ( a, b, c ) ( a, b, c )
>
> Would it be possible to fix that one somehow?
>
> TIA,
> Aleksey
>
>
> #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.

Paul Mensonides


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