Boost logo

Boost :

From: Ryan Saunders (rls_at_[hidden])
Date: 2004-12-01 02:50:40


Hi,

I've been using the preprocessor library quite extensively in my code, and
have a suggested addition to it.

I use the BOOST_PP_ENUM_XXX macros for rapidly creating lists of identical
template parameters. For example, instead of

     template <typename T0, typename T1, typename T2, typename T3>

I can just use

     template <ENUM_PARAMS(3, typename T)>

I notice that there's also a "binary" version that takes two parts and
suffixes the count onto each part. The problem I'm faced with is that I'm
trying to construct parameter lists to other templates, but the actual
parameters are embedded typedefs in the enumerated parameters. I know that
was dense -- here's an example:

     typedef typename meta_func< typename T0::inner_type, typename
T1::inner_type, typename T2::inner_type>::type;

I don't see a way to do this with any of the ENUM_XXX macros. Maybe something
like ENUM_SPLIT_PARAMS(COUNT, PREF, SUFF) that would generate
PREF ## n ## SUFF?

Thanks,
Ryan


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