C
Christof Warlich
Hi,
I need to use boost's BOOST_PP_IF(condition, then, else) macro, with "condition" being evaluated
from a template, e.g. is_convertible<typename A, typename B>.
Thus, with two classes A and B, I'd like to write:
BOOST_PP_IF(is_convertible<A, B>::value, std::cout << "if\n", std::cout << "else\n");
Unfortunately, the preprocessor complains because it sees 4 parameters instead of 3 due to the comma
between the template parameters.
To make my question independent from boost, having a macro like
#define M(x) x
how do I pass something like
someTemplate<x, y> to M(x)?
Thanks for any ideas,
Christof
P.S.: I already tried boost's BOOST_PP_COMMA() macro, but this did not solve the problem.
I need to use boost's BOOST_PP_IF(condition, then, else) macro, with "condition" being evaluated
from a template, e.g. is_convertible<typename A, typename B>.
Thus, with two classes A and B, I'd like to write:
BOOST_PP_IF(is_convertible<A, B>::value, std::cout << "if\n", std::cout << "else\n");
Unfortunately, the preprocessor complains because it sees 4 parameters instead of 3 due to the comma
between the template parameters.
To make my question independent from boost, having a macro like
#define M(x) x
how do I pass something like
someTemplate<x, y> to M(x)?
Thanks for any ideas,
Christof
P.S.: I already tried boost's BOOST_PP_COMMA() macro, but this did not solve the problem.