Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2002-04-11 16:41:35


David Abrahams wrote:
> Given the presence of BOOST_PP_ENUM_PARAMS, which generates a list like:
>
> a0, a1, a2, a3, ... aN
>
> it seems there should also be a way to generate:
>
>
> T0 a0, T1 a1, T2 a2, ... TN aN
>
> built into the library.
>
> #define BOOST_PP_NUMBER_PAIR(Index, Pair) \
> BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,Pair),Index) \
> BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,Pair),Index)
>
> #define BOOST_PP_ENUM_PARAMS2(N, Pair) BOOST_PP_ENUM(N,
> BOOST_PP_NUMBER_PAIR, Pair)
>
> Thoughts?

Here at work we use very much the same macro; ours is called
*_PP_FUNCTION_PARAMS. I think it's worth putting in the library.

Aleksey


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