Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2002-12-12 23:49:00


----- Original Message -----
From: "David Abrahams" <dave_at_[hidden]>

> > I'm not sure what you mean here. You mean overloading
> > "BOOST_WORKAROUND" to cause an error (or warning) if you use
> > "BOOST_CURRENT_VERSION"? That's no problem at all.
>
> I mean that
>
> #if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_CURRENT_VERSION(0x530))
> whatever
> #endif
>
> would have the effect of
>
> #if __SUNPRO_CC != 0
> # if BOOST_DETECT_OUTDATED_WORKAROUNDS && __SUNPRO_CC > 0x530
> # error or warning
> # endif
> whatever
> #endif
>
> While keeping the current semantics for normal uses of
> BOOST_WORKAROUND
>
> And, BTW, can you show us how to do it?

I'm still not sure what you mean. What is the purpose of
"BOOST_CURRENT_VERSION"? I was thinking it was meant to discriminate
between "normal" cases like this:

BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530)
    // i.e. __SUNPRO_CC != 0 && __SUNPRO_CC <= 0x530

-vs.-

BOOST_WORKAROUND(__SUNPRO_CC, BOOST_CURRENT_VERSION(0x530))
// i.e.

__SUNPRO_CC != 0 && 1 % (__SUNPRO_CC > 0x530 ? 0 : 1)

or...

__SUNPRO_CC != 0 && __SUNPRO_CC <= 0x530

...depending on some flag like "BOOST_DETECT_OUTDATED_WORKAROUNDS." If that
is what you want, the syntax has to be slightly different.

BOOST_WORKAROUND(__SUNPRO_CC, (0x530))
BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530)

..or..

BOOST_WORKAROUND(__SUNPRO_CC, (BOOST_CURRENT_VERSION) 0x530)
BOOST_WORKAROUND(__SUNPRO_CC, <= 0x530)

..or..

BOOST_WORKAROUND(__SUNPRO_CC, BOOST_CURRENT_VERSION 0x530)
BOOST_WORKAROUND(__SUNPRO_CC, BOOST_OTHER_VERSION <= 0x530)

In other words, one xor the other is in parentheses or each of them have a
different prefixed identifiers.

If that is what you mean, take your pick. The first one is the cleanest,
the second is the most explicit (and looks like a cast), and the third one
is evil (IMNHO).

Paul Mensonides


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