Boost logo

Boost :

Subject: Re: [boost] Define to test for deprecated std::auto_ptr
From: Beman Dawes (bdawes_at_[hidden])
Date: 2014-12-30 07:40:05


On Tue, Dec 30, 2014 at 7:31 AM, Fletcher, John P <j.p.fletcher_at_[hidden]>
wrote:

> I have some tests which are throwing up std::auto_ptr as deprecated with
> C++11.
>
> Is there a define that can be tested for in user code so that I can switch
> to std::unique_ptr when it is available? Something like this:
>
> #ifdef BOOST_NO_CXX11_UNIQUEPTR
> // use auto_ptr
> #else
> // use unique_ptr
> #endif
>
> Is there a general flag for C++11 or C++14 or is it all done on particular
> features?
>
>
__cplusplus may be helpful. Look at regression tests
www.boost.org/development/tests/develop/developer/config.html config_info
to see how it is defined for various compilers.

HTH

--Beman


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