Hi All
I fear I may be trying to get a square peg in a round hole, but here goes
anyway...
I'm trying to use the boost PreProcessor library to generate constructors
with varying numbers of parameters. I've tried the following:
#include
#include
#include
#ifndef MAX_CONCRETE_CONSTRUCTOR_PARAMS
#define MAX_CONCRETE_CONSTRUCTOR_PARAMS 3
#endif
#define CONCRETE_CONSTRUCTOR(Z, N, _) \
template
\
explicit Concrete( BOOST_PP_ENUM_PARAMS(N, A) ) \
{ }
class Concrete
{
public:
BOOST_PP_REPEAT(BOOST_PP_INC(MAX_CONCRETE_CONSTRUCTOR_PARAMS),
CONCRETE_CONSTRUCTOR, _)
};
int main()
{
Concrete a( 1, 2 );
return EXIT_SUCCESS;
}
But this gives me the following error:
error C2660: 'Concrete::Concrete' : function does not take 2 arguments
I have feeling I'm doing something very wrong or that can't be done.
Regards
Paul
Paul Grenyer
Email: paul@paulgrenyer.co.uk
Web: http://www.paulgrenyer.co.uk
Have you met Aeryn: http://www.paulgrenyer.co.uk/aeryn/?
Version 0.3.0 beta now ready for download