________________________________________ From: Boost [boost-bounces@lists.boost.org] on behalf of Mathias Gaunard [mathias.gaunard@ens-lyon.org] Sent: 02 February 2014 11:17 To: boost@lists.boost.org Subject: Re: [boost] [C++11] Is conditional code allowed? On 02/02/14 01:35, Fletcher, John P wrote:
Is there a way to incorporate C++11 only code into tests or the actual headers.
If so, is there an example of how to do it in Boost?
Boost.Config defines many macros to test whether some C++03 or C++11 features are available. Try to use those as much as possible instead of doing your own compiler detection logic.
http://www.boost.org/doc/libs/release/libs/config/doc/html/index.html
Mathias Thank you, I have selected the following which seems appropriate for my cases. #ifndef BOOST_NO_CXX11_DECLTYPE // C++11 version #else // C++03 workaround if available. #endif I am going to post a test using this to develop. John