Boost logo

Boost :

Subject: Re: [boost] Alternative implementation for BOOST_PP_VARIADIC_SIZE
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2011-11-12 06:52:33

Lorenzo Caminiti <lorcaminiti <at>> writes:
> On Thu, Nov 10, 2011 at 6:43 PM, Gennadiy Rozental <rogeeff <at>>>
> Hi,
> >
> > Current implementation of subject macro have a very serious shortcoming -
> > it does not work for empty __VA_ARGS__. After googling around a bit for
> > some ideas I came up with the following alternative:
> A while back there was a discussion about the
> possibility/impossibility to handle empty macro parameters using
> variadics:
> (Make sure to address the concerns expressed by Paul in the replies to
> the above thread.)

Frankly, I do not have time to read through the whole discussion. I am not a
language lawyer, but for what it worth my version works on all compilers I
have tried and looks to be perfectly legal (to me). I do know about one
limitation. It's where __VA_ARGS__ ends with macro function which produces
comma when evaluated. It's very rare case though and even if it's possible
to implement solution that deals with it (look here: ),
I find the complication does not worth the trouble.

If Edward or Paul care to comment it might be easier for them to point to any
shortcomings in my solution (if any).


Boost list run by bdawes at, gregod at, cpdaniel at, john at