当我尝试使用/std:c++latest
标志在MSVC2015上构建boost时,会出现错误:
boost\algorithm\string\detail\case_conv.hpp(33): error C2143: syntax error: missing ',' before '<'
它指向:
// a tolower functor
template<typename CharT>
struct to_lowerF : public std::unary_function<CharT, CharT>
现在,这似乎是由于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't make sense”,以及一些非标准功能(std::tr1命名空间,一些仅限于TR1的机制和std::identity结构)。
当使用:
std::string a,b;
return boost::iequals(a,b);
使用 boost::ilexicographical_compare
。
这里也提到了:
https://blogs.msdn.microsoft.com/vcblog/2015/06/19/c111417-features-in-vs-2015-rtm/
Stephan T. Lavavej - MSFT Azarien: Removing auto_ptr/etc. will have positive consequences. It will prevent new code from using outdated/complicated/unsafe
machinery, and it will reduce confusion among non-expert users. (For example, unnecessary unary_function/binary_function inheritance is common, because many users thought that STL algorithms/containers required this, when in fact only the outdated adapters did.) And auto_ptr in particular is unsafe, because its mutating "copy" constructor silently moves from lvalues.
那么,我该如何使用VC2015的 /std:c++latest 编译boost呢?目前看来,Boost似乎不兼容C++17?