私は、次のコードをコンパイルするVS 2015(更新3)を使用します。VC++はなぜclangがコードをコンパイルしないのですか?
#include <codecvt>
#include <cctype>
#include <functional>
int main()
{
std::function<int(int)> fn = std::isspace;
}
私はそれをコンパイルするVC++を使用している場合、それは大丈夫です。私は、Visual StudioでVisual Studio 2015 - Clang with Microsoft CodeGen (v140_clang_c2)
にコンパイラを変更する場合は、打ち鳴らすには、エラーを報告し、次のように私は最初の行をコメントしている場合
main.cpp(7,26): error : no viable conversion from '' to 'std::function'
std::function fn = std::isspace;
さらに驚くべき、打ち鳴らすもOKになります。
//#include <codecvt> // now clang feels happy
#include <cctype>
#include <functional>
int main()
{
std::function<int(int)> fn = std::isspace;
}
根本原因は何ですか。