[msvc-14] Status of _HAS_AUTO_PTR_ETC=0 support
Hi,
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
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
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-... Not yet, msvc-14 is too new, and the first to completely remove these deprecated features.
John.
On 2 September 2015 at 18:43, John Maddock
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.
Yes, I confirm it does. I had tried develop as well, but my working copy was outdated.
This basic evaluation made me wonder, does Boost support compilation with _HAS_AUTO_PTR_ETC=0 defined at all?>
Not yet, msvc-14 is too new, and the first to completely remove these deprecated features.
Makes sense. Thanks for the explanation. Best regards, -- Mateusz Loskot, http://mateusz.loskot.net
participants (2)
-
John Maddock
-
Mateusz Loskot