Boost logo

Boost :

Subject: Re: [boost] [PREDEF] Review for the Boost.Predef library by Rene Riviera
From: Artyom Beilis (artyomtnk_at_[hidden])
Date: 2012-02-28 06:52:29


----- Original Message -----
> From: Rene Rivera <grafikrobot_at_[hidden]>
>
> I guess that depends on the developers. The reasons the macros are always
> defined, to zero when not detected, is to reduce the amount of checks when
> writing conditionals. At least in Boost, the common use case goes something like
> this:
>
> #if defined(_some_compiler_) && (_some_compiler_ < 123)
> //...
> #endif
>
>

And in your case it would be

#if boost_some_compiler < boost_version(1,2,3)

Would give you true if the boost_some_compiler == 0 so you
will have to write

#if boost_some_compiler < 0 && boost_some_compiler < boost_version(1,2,3)
...

I don't see too much savings.

Artyom


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