【发布时间】:2017-01-14 18:43:00
【问题描述】:
当我尝试使用带有 /std:c++latest 标志的 MSVC2015 构建提升时,我收到一个错误:
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 分配器参数没有意义”,以及各种 非标准特性(std::tr1 命名空间,一些 TR1-only 机器和 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机械,它将减少非专家用户之间的混淆。 (对于 例如,不必要的 unary_function/binary_function 继承是 常见,因为许多用户认为 STL 算法/容器 需要这个,而实际上只有过时的适配器才需要。)和 auto_ptr 特别是不安全的,因为它的变异“副本” 构造函数默默地从左值移动。
那么,如何使用 VC2015 的 /std:c++latest 进行编译?现在看来 boost 不兼容 C++17?
【问题讨论】:
标签: c++ visual-c++ boost visual-studio-2015 c++17