
13 Nov
2004
13 Nov
'04
11:57 p.m.
Paul Mensonides wrote:
1. Use of PP_SEQ interface to "parse" function name and arguments
int X::foo(char* buf, size_t len) { BOOST_TRACE_MEM_FUN( (foo)(buf, len) );
^^^^^^^^
You can't do this without variadic macros (ala C99). We should have these in C++ eventually, but we don't right now and the pp-lib doesn't support them.
I think he's just using BOOST_PP_SEQ_TAIL to get the arguments. This means that they're never directly accessed by the sequence macros. For example: #define ARGUMENT_STRING(fn) BOOST_PP_STRINGIZE(BOOST_PP_SEQ_TAIL(fn)) ARGUMENT_STRING((foo)(buf, len)) // Expands to "(buf, len)" That works on g++, although I don't know how portable it is. Daniel