|
Boost : |
From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2003-04-11 22:16:19
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".
Aleksey
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk