Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2002-06-17 23:08:20


> From: "Paul Mensonides" <pmenso57_at_[hidden]>
>
> > This will fix the problem--I tested it myself.
>
> Not completely, anyway --
> Paul, if Vesa wants me to I can give you CVS access so you can work on
> these problems.
>
> Thanks for your help,
> Dave

--I don't know how to use the CVS anyway. I just downloaded cygwin the day
before yesterday, and all that I know how to do is login, update -or- checkout,
and logoff. I don't even know how to get the MPL files other than downloading
them from the CVS shell website. :( So, if you want to tell me what I need to do
or where to go for instructions, go ahead. But right now, here is a *partial*
solution that will fix the problem for now--at least the ones I know about
specifically.

Okay. Dave this is what you need to change:

file: preprocessor/logical/bool.hpp

    1. remove the inclusion of <boost/preprocessor/detail/cat.hpp>
    2. redefine BOOST_PP_BOOL as follows:

        #define BOOST_PP_BOOL(X) BOOST_PP_BOOL_DELAY(X)
        #define BOOST_PP_BOOL_DELAY(X) BOOST_PP_BOOL##X

file: preprocessor/if.hpp

    1. remove the inclusion of <boost/preprocessor/detail/cat.hpp>
    2. redefine BOOST_PP_IF as follows:

        #define BOOST_PP_IF(COND,THEN,ELSE) \
            BOOST_PP_IF_BOOL(BOOST_PP_BOOL(COND),THEN,ELSE)
        #define BOOST_PP_IF_BOOL(COND,THEN,ELSE) \
            BOOST_PP_IF_BOOL_DELAY(COND,THEN,ELSE)
        #define BOOST_PP_IF_BOOL_DELAY(COND,THEN,ELSE) \
            BOOST_PP_IF##COND(ELSE,THEN)
        //--------------------^ note these are backwards

Also, if you like you can fix the ordering of ELSE and THEN if you fix the IF0
and IF1 macros appropriately. That is a relic from when Vesa was using
TUPLE_ELEM to get the elements. So, if you switch those two arguments in the
last 'call' above, you also have to change these right below:

    #define BOOST_PP_IF0(T,E) E
    #define BOOST_PP_IF1(T,E) T

That should fix all the problems in 'apply.hpp' and 'count_if_not.hpp' (and
possibly others). However, I swear this is going to come up again. A few days
ago, Vesa changed a whole bunch of macros to use BOOST_PP_DETAIL_CAT2 (etc.)
instead of having delay macros like the above. While what he did is legal and
compiles on compliant compilers, VC++ chokes to death on it. In any case, the
CVS change logs are filled with "Using private detail CAT to avoid DELAY macros"
notes. They are all going to have to be changed back at some point. Either
that, or have separate implementations for VC++ and possibly Metrowerks.

Paul Mensonides


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