
2015-01-28 16:16 GMT+01:00 Peter Dimov
Andrzej Krzemienski wrote:
Hi Everyone, I have a couple of concerns regarding macro BOOST_WORKAROUND.
Hi Andrzej,
1. Is usage thereof recommended?
Yes, I think so.
2. Why is it documented in Boost.Config but defined in Boost.Detail?
3. Should it not belong to Boost.Config?
The header is in boost/detail for historical reasons, but it's part of Boost.Config, not Boost.Detail.
4. Why should I use it rather than manual if (BOOST_INTEL < 551) ?
BOOST_WORKAROUNDs can be deactivated globally with BOOST_STRICT_CONFIG. This is useful, f.ex. when testing whether workarounds are necessary on a newer compiler version. This doesn't apply to BOOST_INTEL < 551, but in many cases before the introduction of BOOST_WORKAROUND, the workarounds did not test against a maximum version and were, again for example, activated for all MSVC versions, present and future.
Since the path without the BOOST_WORKAROUND is supposed to be the conforming one, compiler vendors can use Boost with BOOST_STRICT_CONFIG as a conformance test.
Now, that it is in Boost.Detail, I have to make a dependency on
Boost.Detail, and indirectly on Boost.MPL because other components in Boost.Detail do.
Including boost/detail/workaround.hpp is a dependency on Boost.Config, not Boost.Detail. That's because the header is actually in libs/config/boost/detail/workaround.hpp, not in libs/detail. So it's not a problem. See for example
http://www.pdimov.com/tmp/report-develop-c3bb6eb/core.html#config
Ok, I see. Thanks for the explanation. Regards, &rzej