Boost logo

Boost :

Subject: Re: [boost] [preprocessor] missing IS_EMPTY documentation?
From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2010-09-06 19:30:07


On 9/6/2010 3:17 PM, Wolf Lammen wrote:
> I wrote wrt to BOOST_PP_IS_EMPTY:
>
> "I think it is not part of the API, because it does not conform to C90. You must not submit parameters to macros that expand to nothing, because C90 does not cover this situation"
>
> The relevant portions of the standard makes it clear:
>
> "If (before argument substitution) any argument consists of no preprocessing tokens, the behavior is undefined." ... "After the arguments for the invocation of a function-like macro have been identified, argument substitution takes place" ... "Before being substituted, each argument's preprocessing tokens are completely macro replaced as if they formed the rest of the source file"
>
> Paul Mensonides is right, an argument must not be empty, when it is collected, but it may be at the moment when it is substituted for a parameter. I was mislead by the double mention and meaning of "substitute/substitution", but argument substitution (as opposed to parameter substitution) is the combined process of expanding the argument and substitution for a parameter, and checking
> for emptyness takes place prior to "argument substitution".
>
> I apologize for having given a wrong interpretation and hope this have not lead to too much confusion.

Luckily, it no longer matters in C and will no longer matter in C++ shortly.

Regards,
Paul Mensonides


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk