Boost logo

Boost Users :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2005-02-13 21:21:35


> -----Original Message-----
> From: boost-users-bounces_at_[hidden]
> [mailto:boost-users-bounces_at_[hidden]] On Behalf Of
> Arkadiy Vertleyb

> "Thorsten Ottosen" <nesotto_at_[hidden]> wrote
>
> > I would to generate this list with the preprocessot lib:
> >
> > typename decay<T1>::type, typename decay<T2>::type ....
>
> #define PARAM(z, n, data) \
> typename decay< T ## n >::type
>
> BOOST_PP_ENUM(n, PARAM, ~)

You can also use BOOST_PP_INTERCEPT, which was designed for this type of
situation.

#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>

BOOST_PP_ENUM_BINARY_PARAMS(3, typename decay<T, >::type BOOST_PP_INTERCEPT)

The BOOST_PP_INTERCEPT macro is used to intercept and discard a numeric
concatenation like BOOST_PP_ENUM_PARAMS does to its argument and
BOOST_PP_ENUM_BINARY_PARAMS does to two arguments.

Regards,
Paul Mensonides


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