Boost logo

Boost :

From: Jason Hise (chaos_at_[hidden])
Date: 2005-09-14 00:42:27


Background: I am using a few functions which have the following form:

void create ( );

template < typename P1 >
void create ( P1 p1 );

template < typename P1, typename P2 >
void create ( P1 p1, P2 p2 );
[...]

I am trying to generate these using the boost preprocessor library, but
I am getting an error. This is probably because I do not fully
understand how the order of expansion of function-like macros works.
The error is:
warning C4002: too many actual parameters for macro 'BOOST_PP_IIF_1'

My code is as follows:

#define BOOST_PP_LOCAL_LIMITS (0,
BOOST_SINGLETON_PTR_MAX_CONSTRUCTOR_PARAMS)
#define BOOST_PP_LOCAL_MACRO(n) \
BOOST_PP_IF(n, template < BOOST_PP_ENUM_PARAMS(n, typename P) >, \
BOOST_PP_EMPTY()) void create ( BOOST_PP_ENUM_BINARY_PARAMS(n, \
    typename ::boost::call_traits < P, >::param_type p ) ) \
{ \
    policy_ptr->get_creator ( )->create \
        ( BOOST_PP_ENUM_PARAMS(n, p) ); \
}
#include BOOST_PP_LOCAL_ITERATE()

What am I doing wrong?

-Jason


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