clang 3.9、auto_ptr 和 boost

Kry*_*rys 2 c++ boost clang

I encountered errors when trying to compile boost with clang 3.9 in c++1z mode since auto_ptr is removed in c++17. However, I successfully compiled boost with c++14 mode and linked the lib files to the executables compiled with c++1z mode. So, is there going to be any ABI issues or potential bugs in the future ?

Mar*_*low 5

不应该有任何 ABI 问题auto_ptr,因为它是仅标头的功能 - libc++.dylib 中没有任何内容。

您还可以auto_ptr通过_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR在包含任何 libc++ 头文件之前定义来返回libc++。

最好的解决方案是询问维护者auto_ptr在为 C++17 编译时不要使用的任何 boost 库。