Boost logo

Boost Users :

Subject: Re: [Boost-users] [msvc-14] Status of _HAS_AUTO_PTR_ETC=0 support
From: John Maddock (jz.maddock_at_[hidden])
Date: 2015-09-02 12:43:59


> VS2015 allows to disable the C++ library features deprecated in C++11:
>
> [1] "By default, we provide auto_ptr/etc. If you define _HAS_AUTO_PTR_ETC to 0
> project-wide (which you should do via the command line or project file,
> not via #define), then we won't provide auto_ptr/etc."
>
> Attempt to compile the following test.cpp based on up-to-date Boost
> (master) fails:
>
> #include <boost/algorithm/string.hpp>
> int main() { return 0; }
>
> cl /EHsc /ID:\dev\boost.git /D_HAS_AUTO_PTR_ETC=0 test.cpp
>
> Below are two problems that can be solved with additional define of
> BOOST_NO_AUTO_PTR=1
>
> D:\dev\boost.git\boost/get_pointer.hpp(48): error C2065: 'auto_ptr':
> undeclared identifier
> D:\dev\boost.git\boost/get_pointer.hpp(62): error C2923:
> 'std::unique_ptr': 'T' is not a valid template type argument for
> parameter '_Ty'
>
> I also expected _HAS_AUTO_PTR_ETC=0 should imply BOOST_NO_AUTO_PTR=1.
It does in develop, it's just not in master yet.
> Then, I hoped this would work:
>
> cl /EHsc /ID:\dev\boost.git /D_HAS_AUTO_PTR_ETC=0 /DBOOST_NO_AUTO_PTR=1 test.cpp
>
> Unfortunately, it fails due to uses of std::unary_function and
> std::binary_function
> in boost/algorithm/string/detail/case_conv.hpp. Those functions have
> been deprecated
> since C++11 and are disable by _HAS_AUTO_PTR_ETC=0.
Someone will have to supply a separate patch for those - looks like we
need a new config macro as well.
> This basic evaluation made me wonder, does Boost support compilation
> with _HAS_AUTO_PTR_ETC=0 defined at all?
>
> [1] http://blogs.msdn.com/b/vcblog/archive/2015/04/29/c-11-14-17-features-in-vs-2015-rc.aspx
Not yet, msvc-14 is too new, and the first to completely remove these
deprecated features.

John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net