Terje Slettebų wrote:

>> MACRO( IN(2, (std::pair<int, int>)) )
>
> I'm not sure how this latter solution could be used. How could MACRO
> retrieve the type being passed?

You have to encode the type in a structure, and then decode it when you actually
need it:

#define IN(s, x) (s) x
#define OUT(type) BOOST_PP_TUPLE_REM type

#define MACRO(z, i, type) \
    BOOST_PP_CAT(class T, i) = OUT(type) \
    /**/

template<
    BOOST_PP_ENUM(
        3, MACRO,
        IN(2, (std::pair<int, int>))
    )
> class xyz;

Passing in an intermediate value like this:

#define ID2(a, b) a, b
#define MACRO(x) x

MACRO( ID2( std::pair<int, int> ) )

...is error prone (and dangerous).  :(

Regards,
Paul Mensonides

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to