Handling mulitiple boost versions
As I'm sure is common I write code that builds under several versions of Boost which often results in code like... #if (BOOST_VERSION < 103400) do this #else do that #endif This is specifically true for changes to Boost.Filesystem, but also in other places. Usually the difference being addressed is obvious, but not always, and in any case direct use of "103400" seems to be like a magic number to me. So, I'd like to do something like this in a global header (in one place for many versions and capabilities) #if (BOOST_VERSION < 103400) #define BOOST_PRE_FILESYSTEM_RATIONALISATION #endif and then say #ifdef BOOST_PRE_FILESYSTEM_RATIONALISATION do this #else do that #endif Is this unwise for any reason I'm not seeing, and are the tokens I'm defining already defined somewhere, so I can use those instead? Thx - Rob.
On 16 December 2010 05:28, Robert Jones
#if (BOOST_VERSION < 103400) #define BOOST_PRE_FILESYSTEM_RATIONALISATION #endif
I wouldn't use BOOST_* for your own macros, as they are reserved for Boost library implementers http://www.boost.org/development/requirements.html. -- Nevin ":-)" Liber mailto:nevin@eviloverlord.com (847) 691-1404
participants (2)
-
Nevin Liber
-
Robert Jones