12 Dec
2012
12 Dec
'12
4:16 a.m.
In fact, when I change the definition of the intercept() macro below to:
#define intercept(FIRST, ARGS...) \ targetfunc(transform(FIRST) \ , boost::lexical_caststd::string(BOOST_PP_VARIADIC_SIZE(ARGS)))
I see that BOOST_PP_VARIADIC_SIZE() expands to 1 for intercept("first") as well as for intercept("first", "second").
As I understand it, it is impossible to reliably detect an empty argument list in all cases, so BOOST_PP_VARIADIC_SIZE() returns 1 for an empty argument list. Take a look at this thread [1] for an explanation and a workaround. Regards, Nate [1] http://boost.2283326.n4.nabble.com/Alternative-implementation-for-BOOST-PP-V...