xml*_*lmx 4 c++ compiler-errors clang visual-c++ c++11
我使用VS 2015(Update 3)编译以下代码:
#include <codecvt>
#include <cctype>
#include <functional>
int main()
{
std::function<int(int)> fn = std::isspace;
}
Run Code Online (Sandbox Code Playgroud)
如果我使用VC++编译它,那没关系.但是,如果我Visual Studio 2015 - Clang with Microsoft CodeGen (v140_clang_c2)在Visual Studio 中将编译器更改为,则clang会报告错误:
main.cpp(7,26):错误:没有可行的从''转换为'std :: function'
std :: function fn = std :: isspace;
更令人惊讶的是,如果我评论第一行如下,clang也会好的.
//#include <codecvt> // now clang feels happy
#include <cctype>
#include <functional>
int main()
{
std::function<int(int)> fn = std::isspace;
}
Run Code Online (Sandbox Code Playgroud)
根本原因是什么?