pau*_*ulm 8 c++ boost visual-c++ visual-studio-2015 c++17
当我尝试使用带有/std:c++latest
标志的MSVC2015构建boost时出现错误:
boost\algorithm\string\detail\case_conv.hpp(33): error C2143: syntax error: missing ',' before '<'
Run Code Online (Sandbox Code Playgroud)
哪个指向:
// a tolower functor
template<typename CharT>
struct to_lowerF : public std::unary_function<CharT, CharT>
Run Code Online (Sandbox Code Playgroud)
现在这似乎是由于这里提到的N4190:https://www.visualstudio.com/en-us/news/releasenotes/vs2015-update3-vs
/ std:c ++ latest还控制删除以下旧功能:N4190"删除auto_ptr,random_shuffle()和旧东西",P0004R1"删除不推荐的Iostreams别名",LWG 2385"function :: assign allocator argument doesn" "有意义",以及各种非标准特性(std :: tr1命名空间,一些TR1专用机制和std :: identity结构).
使用时:
std::string a,b;
return boost::iequals(a,b);
Run Code Online (Sandbox Code Playgroud)
并使用boost::ilexicographical_compare
.
它也在这里提到:
https://blogs.msdn.microsoft.com/vcblog/2015/06/19/c111417-features-in-vs-2015-rtm/
Run Code Online (Sandbox Code Playgroud)Stephan T. Lavavej - MSFT Azarien: Removing auto_ptr/etc. will have positive consequences. It will prevent new code from using outdated/complicated/unsafe
机器,它将减少非专家用户之间的混淆.(例如,不必要的unary_function/binary_function继承是常见的,因为许多用户认为STL算法/容器需要这个,而实际上只有过时的适配器.)而auto_ptr特别不安全,因为它的变异"复制"构造函数默默地移动来自左撇子.
那么如何使用VC2015的/ std:c ++最新版进行编译?现在看来,boost不兼容C++ 17吗?
_HAS_AUTO_PTR_ETC
在包含任何标头之前定义宏.对于您自己的代码,如果您使用的是Visual Studio的构建系统,最好通过项目的预处理程序定义设置来完成.要构建Boost本身,请添加define=_HAS_AUTO_PTR_ETC
到b2
/ bjam
调用.
其他通过隐含禁用以前的标准功能/std:c++latest
可以通过定义宏来控制_HAS_FUNCTION_ASSIGN
,_HAS_OLD_IOSTREAMS_MEMBERS
和_HAS_TR1_NAMESPACE
.以下博客文章中概述了这些宏:
STL修复VS 2015 Update 3
VS 2015 Update 2的STL是C++ 17-so-far功能完整版