Boost logo

Boost :

Subject: Re: [boost] [preprocessor] question
From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2012-10-23 12:54:41


On 10/23/2012 5:46 AM, Jorge Lodos Vigil wrote:
> This is regarding to BOOST_PP_IS_NULLARY macro.
> I would like to use it with only 2 types of inputs:
>
> 1. Empty parenthesis: ()
>
> 2. Plain C++ identifier within parenthesis: (identifier)
> With this input restrictions, is it safe to use BOOST_PP_IS_NULLARY in portable code that must be compiled in different platforms?
> Thanks in advance.

I can't speak for all compilers, but it should work on the major ones.
The input can be anything except that it must be one argument (i.e. no
open commas) and it must not begin with a parenthetic expression which
is non-nullary. I.e. IS_NULLARY(() abc) is fine and will expand to 1,
IS_NULLARY(abc (p, q)) is fine and will expands to 0, but IS_NULLARY((p,
q) x) violates the domain restriction and should yield an error.

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