Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2004-12-01 19:00:07


> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of Ryan Saunders

Hi Ryan.

> 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?

The ENUM_BINARY_PARAMS is the general form for this kind of stuff. You
typically use it with INTERCEPT, such as:

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

BOOST_PP_ENUM_BINARY_PARAMS(
    3, typename T, ::inner_type BOOST_PP_INTERCEPT
)

INTERCEPT (unsurpisingly) intercepts the numeric concatenation and expands to
nothing.

Normally the library avoids macros that have very specific uses. In fact,
ENUM_PARAMS and ENUM_BINARY_PARAMS are probably the two most domain-specific
macros in the library. If the usage scenario is too complex for ENUM_PARAMS or
ENUM_BINARY_PARAMS (possibly with INTERCEPT), then you need to use the much more
general form, ENUM.

Regards,
Paul Mensonides


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