|
Boost : |
Subject: Re: [boost] [C++11] Is conditional code allowed?
From: Glen Fernandes (glen.fernandes_at_[hidden])
Date: 2014-02-01 19:43:42
On Sat, Feb 1, 2014 at 4:35 PM, Fletcher, John P
<j.p.fletcher_at_[hidden]> 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?
This is what I do it in Boost.Smart_Ptr tests around C++11 only
features: https://github.com/boostorg/smart_ptr/blob/develop/test/make_unique_args_test.cpp
e.g. Any tests relating to std::unique_ptr features are entirely
enabled only when BOOST_NO_CXX11_SMART_PTR is not defined. Any
specific test cases within that code are enabled only when certain
C++11 features are present; e.g. if BOOST_NO_CXX11_VARIADIC_TEMPLATES
is not defined.
Glen
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk