Boost logo

Boost Users :

Subject: [Boost-users] [msvc-14] Status of _HAS_AUTO_PTR_ETC=0 support
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2015-09-02 11:58:10


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

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.

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
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.

This basic evaluation made me wonder, does Boost support compilation
with _HAS_AUTO_PTR_ETC=0 defined at all?


Best regards,

Mateusz  Loskot,

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at