Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-07-17 09:48:03


Gennaro Prota <gennaro_prota_at_[hidden]> writes:

> On Sun, 16 Jul 2006 21:02:30 -0400, David Abrahams
> <dave_at_[hidden]> wrote:
>
>>These cases are comparitively rare
>>
>>#if BOOST_CXX_FOO >= BOOST_VERSION_NUMBER(2,0,0) \
>> && BOOST_CXX_FOO < BOOST_VERSION_NUMBER(3,0,0)
>>
>>> or 'if major=3 and minor>2', so I'd rather need BOOST_CXX_FOO_MAJOR etc.
>>
>>#if BOOST_CXX_FOO >= BOOST_VERSION_NUMBER(3,2,0) \
>> && BOOST_CXX_FOO < BOOST_VERSION_NUMBER(4,0,0)
>
> We can do better than that, stay tuned! :) The last piece of the
> puzzle, now, is choosing a migration plan. BOOST_WORKAROUND will have
> a different interface and I don't think it is feasible to replace all
> invocations in one sweep (though I haven't actually counted them) and
> even if it is the risk of destabilization is high. What about
> momentarily use BOOST_WORKAROUND_2 as name for the new macro and
> gradually do the transition? At the end, we would have just to change
> BOOST_WORKAROUND_2 to BOOST_WORKAROUND everywhere. Not that I like
> this too much but this is the only idea that I have.

You might be able to do something like

    BOOST_WORKAROUND(CXX_GCC, VERSION <= (3)(4)(2))

as a transition step, and then when you're done, just make "VERSION"
optional. That would also allow checking just major, or just
major+minor versions:

    BOOST_WORKAROUND(CXX_GCC, VERSION <= (3)(4))

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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