Boost logo

Boost :

From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2005-07-10 15:48:23


David Abrahams wrote:
> Tobias Schwinger <tschwinger_at_[hidden]> writes:
>
>
>>How about these?
>>
>> #define BOOST_COMPILER_WITH_VERSION(compiler,version) \
>> (compiler == version)
>>
>> #define BOOST_COMPILER_ABOVE_VERSION(compiler,version) \
>> (compiler > version)
>>
>> #define BOOST_COMPILER_FROM_VERSION(compiler,version) \
>> (compiler >= version)
>>
>> #define BOOST_COMPILER_BELOW_VERSION(compiler,version) \
>> ((compiler != 0) && (compiler < version))
>>
>> #define BOOST_COMPILER_UP_TO_VERSION(compiler,version) \
>> ((compiler != 0) && (compiler <= version))
>>
>> #define BOOST_COMPILER_FROM_TO_VERSION(compiler,min_version,max_version) \
>> ((compiler != 0) && ((compiler >= min_version) && (compiler <= max_version)))
>
>
> No. That's what BOOST_WORKAROUND does, and BOOST_WORKAROUND does it
> better. Please read
> http://www.boost-consulting.com/boost/boost/detail/workaround.hpp
>

Know it already. Personally I'm not too much into the stuff I posted either. But
the code shows a reasonable set of comparison operations if we encode them in the
macro name.

We might as well (which seems even better to me) take the comparison operator as
part of the macro argument like BOOST_WORKAROUND does:

   #define BOOST_MSVC_VERSION(test) (defined(BOOST_MSVC) && (BOOST_MSVC test))

And while we're at it -- I'ld like a variant of BOOST_TESTED_AT, "BOOST_TESTED"
that also takes the comparison operator:

    BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED(> 1200))

Thanks,

Tobias


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