|
Boost : |
Subject: Re: [boost] [preprocessor] missing IS_EMPTY documentation?
From: Wolf Lammen (ookami1_at_[hidden])
Date: 2010-09-06 18:17:00
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.
Regards
Wolf Lammen
-- GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk