Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2002-12-17 11:26:32


On Tue, 17 Dec 2002 11:44:12 -0000, "John Maddock"
<jm_at_[hidden]> wrote:

>Personally I would rather that you stuck to the simplest possible
>implementation, and for me that outweighs the advantages that using the pp
>lib might bring. The recent discussion is all very clever, but I'm not
>convinced that it really adds anything.

As to possible alternatives, my idea is to use two different macros:
the BOOST_WORKAROUND version, which Dave has already implemented, and
another one that doesn't let you specify a test, just the version. The
point is: what test could the user specify that can be negated without
giving unwanted errors when detection of outdated workarounds is
enabled? Basically, only <= (For instance: if you specify == 0x600,
you just risk to get an error when testing with version 0x500). That
considered, I would say: let him just specify the version with
something like

 #define ERROR(cond) (1 / (cond? 0 : 1))
 #define WORKAROUND_WITH_CHECK(symbol, version) ( \
        ((symbol) != 0) \
        && ERROR(DETECT_OUTDATED && (symbol > version) ) \
                  )

Of course, since the purpose was just to illustrate the idea the
(unprefixed) macro names here are almost chosen at random ;-) Better
ones are welcome.

Genny.


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