Subject: Re: [boost] Alternative implementation for BOOST_PP_VARIADIC_SIZE
From: Jens Gustedt (jens.gustedt_at_[hidden])
Date: 2011-11-14 14:13:17
Paul Mensonides <pmenso57 <at> comcast.net> writes:
> You cannot detect emptiness in the general case
> (even excluding
> pathological input such as unbalanced parentheses). This is simply a
could you please give us some arguments for such a strong statement?
P99_IS_EMPTY does at least pretty well, and contrary to Edward Diener's false
assertion somewhere in this thread, it does well with function like macros
> You can attack the problem in a variety of different ways, but all
> of them have limitations that restrict the domain on input.
really I would like to see some meat to that claim
> Regardless, the scenario here is fundamentally wrong-headed. A macro
> argument may be empty, but that does not change the number of arguments.
> #define A(...)
> A() // one argument (*not* zero arguments)
> B(,) // two arguments
> C(,,) // three arguments
I completely agree with that part. In P99 I use that in particular to provide
default arguments for functions, and there it is important to have A() detect
that this is an empty argument and to produce the default.
(Default arguments with macros is probably not an issue for boost, since this is
for C++ which has default arguments in the core language. P99 is for C99 which
> A( ) // one argument containing a space
> The only to have a function-like macro that takes zero arguments is to
> define the macro as nullary.
I didn't capture what you try to say, here.