
28 Jan
2006
28 Jan
'06
3:38 p.m.
Arkadiy Vertleyb wrote:
Hi,
The following code:
#include <boost/preprocessor/control/if.hpp> #include <boost/preprocessor/enum_params.hpp> BOOST_PP_ENUM_PARAMS(3, p) BOOST_PP_IF(1, BOOST_PP_ENUM_PARAMS(3, p), blah)
results in the following text (vc71, main CVS):
p0 , p1 , p2 p0
and a warning:
to many parameters for BOOST_PP_IIF_1.
What's wrong?
"Being lazy" solves the problem: #include <boost/preprocessor/control/if.hpp> #include <boost/preprocessor/enum_params.hpp> #include <boost/preprocessor/tuple/eat.hpp> BOOST_PP_ENUM_PARAMS(3, p) BOOST_PP_IF(1, BOOST_PP_ENUM_PARAMS, blah BOOST_PP_TUPLE_EAT(2))(3,p) Note: - BOOST_PP_IF does not get disabled - lazy invocation => no repetition in the "else-case". Regards, Tobias