Boost logo

Boost :

Subject: Re: [boost] Boost 1.49 BOOST_PP_ITERATION_FLAGS(): causes build failures; would like a boost maintainer comment
From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2012-03-13 10:56:24


On Tue, 13 Mar 2012 08:26:06 -0500, Steve M. Robbins wrote:

>> I suppose that I *could* define all of these (it isn't just
>> BOOST_PP_ITERATION_FLAGS) to have values in the non-iterating case such
>> as:
>>
>> #define BOOST_PP_ITERATION_FLAGS_0() 0 // etc.
>
> If I were to pursue this option, which other macros would need to be
> defined?

This isn't a good option. Essentially, GCC makes the code pattern...

#if !defined(MACRO)
    // A
#elif MACRO()
    // B
#endif

...untenable (or at least dependent on the contents of A).

This is not a problem with the definitions in the pp-lib. This is a
general issue with either GCC or the C/C++ languages themselves (if GCC is
actually correctly implementing the *intent* of the standards). The fix
and/or workaround is to change the usage pattern to the (more verbose):

#if !defined(MACRO)
    // A
#else
    #if MACRO()
        // B
    #endif
#endif

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